Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

Converting Binary to Octal
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
CMSC 104, Version 9/01 1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. 1 Number Systems 0, 1 0, 1, 2, 3, 4, 5, 6, 7 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 0, 1, 2, 3,
Chapter 16 Binary and Hexadecimal Numbers. §16.2 thru 16.3 – Addition and Subtraction of Binary Numbers Binary = Base 2 Addition and subtraction are similar.
Binary and Hexadecimal Numbers
Number Systems.
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
Simple Data Type Representation and conversion of numbers
Number Systems Binary and Hexadecimal. Base 2 a.k.a. Binary  Binary works off of base of 2 instead of a base 10 like what we are taught in school 
Numeral Systems Subjects: Numeral System Positional systems Decimal
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
Binary Numbers.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
Data Representation in Computer Systems. 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers.
CMSC104 Lecture 2 Remember to report to the lab on Wednesday.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
Number systems, Operations, and Codes
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Number Base Conversions
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Number Systems 0, 1 0, 1, 2,
Introduction to Number System
Octal to Decimal Hexadecimal DecimalOctal Binary.
AEEE2031 Data Representation and Numbering Systems.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Machine Architecture and Number Systems
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
CMSC Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number.
Topic 14.1 Extended Hexadecimal  Decimal is base 10 and uses 10 digits (0,1,2,3,4,5,6,7,8,9).  Binary is base 2 and uses 2 digits (0,1).  Computers.
Computer Number System
Binary Decimal Hexadecimal
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
CMSC 1041 Binary / Hex Binary and Hex The number systems of Computer Science.
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
Week 1(Number System) Muhammad Ammad uddin Logic Design Lab I (CEN211)
Dr. Clincy Slide 1 CS Chapter 2 (Part 1 of 3) Dr. Clincy Professor of CS Ch 2 Appendix pages will not be on the exam – already covered this.
UMBC CMSC 104 – Section 01, Fall UMBC CMSC 104, Section 01 - Fall 2016  Nothing. Enjoy your weekend! 2.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Programmable Logic Controller
Appendix F Number Systems binary 0, 1 0, 1, 2, 3, 4, 5, 6, 7
Computer Architecture and Number Systems
Introduction To Number Systems
Octal to Decimal Decimal Octal Binary Hexadecimal.
Discrete Mathematics Numbering System.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Dr. Clincy Professor of CS
Convert Decimal to Binary
Tools of Web Development 1: Module A: Numbering Systems
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Number Systems and Binary Arithmetic
Introduction to IT By: Muhammed s. anwar.
Dr. Clincy Professor of CS
Numbering System TODAY AND TOMORROW 11th Edition
Binary / Hex Binary and Hex The number systems of Computer Science.
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Chapter Four Data Representation in Computers By Bezawit E.
Notes from Last Class Office Hours: GL Accounts?
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Machine Architecture and Number Systems
Presentation transcript:

Number Systems

Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary  The Hexadecimal Number System  (r-1)’s and r’s compliment

Number Systems The on and off states of the capacitors in RAM can be thought of as the values 1 and 0, respectively. Therefore, thinking about how information is stored in RAM requires knowledge of the binary (base 2) number system.

BINARY NUMBER SYSTEM 3/13/20164

The Binary Number System  The binary number system is also known as base 2. The values of the positions are calculated by taking 2 to some power.  Why is the base 2 for binary numbers? Because we use 2 digits, the digits 0 and 1.

The Binary Number System  The binary number system is also a positional numbering system.  Instead of using ten digits, 0 - 9, the binary system uses only two digits, 0 and 1.  Example of a binary number and the values of the positions:  

Converting from Binary to Decimal  X 2 0 = 1  X 2 1 = 0  1 X 2 2 = 4  2 0 = = 16 1 X 2 3 = 8  2 1 = = 32 0 X 2 4 = 0  2 2 = = 64 0 X 2 5 = 0  2 3 = 81 X 2 6 = 64 decimal=(77) 10

DECIMAL NUMBER SYSTEM

The Decimal Number System  The decimal number system is also known as base 10.  The values of the positions are calculated by taking 10 to some power.  Why is the base 10 for decimal numbers? Because we use 10 digits, the digits 0 through 9.

The Decimal Number System  The decimal number system is a positional number system.  Example: =

The Decimal Number System

Converting From Decimal to Binary Make a list of the binary place values up to the number being converted. Perform successive divisions by 2, placing the remainder of 0 or 1 in each of the positions from right to left. Continue until the quotient is zero

OCTAL NUMBER SYSTEM 3/13/201613

Octal Number System (Base-8 ) The octal number system uses EIGHT values to represent numbers. The values are, /13/201614

Convert octal to decimal. Example: (264) 8 Each column represents a power of 8, 264 becomes * 8 0 = 4 6 * 8 1 = 48 2 * 8 2 = 128 adding the results together gives /13/201615

DECIMAL TO OCTAL Example: convert (177) 10 to octal 177 / 8 = 22 remainder is 1 22 / 8 = 2 remainder is 6 2 / 8 = 0 remainder is 2 Answer = (2 6 1) 8 Note: the answer is read from bottom to top as (261) 8, the same as with the binary case. 3/13/201616

Working with Large Numbers = ?  Humans can’t work well with binary numbers; there are too many digits to deal with.  Memory addresses and other data can be quite large. Therefore, we sometimes use the hexadecimal number system.

The Hexadecimal Number System The hexadecimal number system is also known as base 16. The values of the positions are calculated by taking 16 to some power. Why is the base 16 for hexadecimal numbers ? Because we use 16 symbols, the digits 0 through 9 and the letters A through F.

The Hexadecimal Number System Binary Decimal Hexadecimal A B C D E F

The Hexadecimal Number System Example of a hexadecimal number and the values of the positions:  3 C 8 B 

Conversion of hex to decimal ( base 16 to base10) Example: convert (F4C) 16 to decimal =>(F x 16 2 ) + (4 x 16 1 ) + (C x 16 0 ) => (15 x 256) + (4 x 16) + (12 x 1) 3/13/201621

Conversion of decimal to hex ( base 10 to base 16) Example: convert (4768) 10 to hex. => 4768 / 16 = 298 remainder 0 =>298 / 16 = 18 remainder 10 (A) =>18 / 16 = 1 remainder 2 =>1 / 16 = 0 remainder 1 Answer: (1 2 A 0) 16 Note: the answer is read from bottom to top, same as with the binary case. 3/13/201622

Octal to hexadecimal conversion The conversion is made in two steps using binary as an intermediate base. Octal is converted to binary and then binary to hexadecimal, grouping digits by fours, which correspond each to a hexadecimal digit. For instance, convert (1057) 8 to hexadecimal: To binary : Then to hexadecimal: 3/13/ F

REPRESENTATION OF NUMBERS

COMPLEMENT OF NUMBERS Two types of complements for base R number system: R's complement and (R-1)'s complement

 The (R-1)'s Complement Subtract each digit of a number from (R-1) FOR DECIMAL NUMBERS (r-1)=9 and for binary numbers (r-1)=1 Example:  9's complement of is  1's complement of is (bit by bit complement operation)  The (r – 1)’s complement of octal or hexadecimal numbers are obtained by subtracting each digit from 7 or F (decimal 15) respectively.

(r’s) Complement The r’s complement is obtained by adding 1 to the (r – 1)’s complement since r n – N = [(r n – 1) – N] + 1. Thus the 10’s complement of the decimal 2389 is = 7611 and is obtained by adding 1 to the 9’s complement value. The 2’s complement of binary is = and is obtained by adding 1 to the 1’s complement value. 3/13/201627

Add 1 to the low-order digit of its (R-1)'s complement Example - 10's complement of is = 's complement of is =