Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Architecture CST 250

Similar presentations


Presentation on theme: "Computer Architecture CST 250"— Presentation transcript:

1 Computer Architecture CST 250
Number Systems in Brief Prepared by:Omar Hirzallah

2 Contents The Number Systems Conversions ASCII Coding BCD Address Range
Binary Numbers Binary Arithmetic (Add. & Sub.) S & M, 1’s & 2’s Complement Methods

3 THE NUMBER SYSTEM (1) Binary Number System (0,1) Base 2
(2) Octal Number System (0,1,2,3,4,5,6,7) Base 8 (3) Decimal Number System (Denary) (0,1,2,3,4,5,6,7,8,9) Base 10 (4) Hexadecimal Number System (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F) Base 16

4 The ASCII Code ASCII stands for “American Standard Codes for Information Interchange”. H= e= l = l = o= It’s a bit method. 7 bits for code values and 1 bit for Parity check.

5 Binary Coded Decimal Decimal Symbol BCD Digit 0000 1 0001 2 0010 3
0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001

6 8 7 1000 0111 The Binary Coded Decimals (BCD)
ASCII Codes use 1 byte for 1 character to store Whereas BCD can be used to save memory space by putting two characters in one byte. Example: 87 can be written as 8 7 1000 0111

7 No. of Different Codes = 2n
THE ADDRESS RANGE: The Formula to calculate the no. of different combinations /addresses range according to the no. of bits: No. of Different Codes = 2n (Where n is no. of bits.) For Example: If there are two bits then: No. of Different Codes = 22 = 2 x 2 = 4 For Example: If there are three bits then: No. of Different Codes = 23 = 2 x 2 x 2 = 8

8 The Binary Numbers The Example of Unsigned Binary Numbers:
Signed Binary Numbers (+ or -) The Example of Unsigned Binary Numbers: Decimal Equivalent 25 M.S.B. L.S.B. M.S.B. Most Significance Bit L.S.B. Least Significance Bit

9 Signed (- or +) binary numbers
There are two very famous notations in dealing with Sign & Magnitude Method (7 + 1 bit method): Sign Bit Magnitude Complement Method (2’s complement): 2’s Complement = 1’s complement +1 1’s complement : Convert all 1s to 0s and a 0s to 1s

10 1’s Complement : Convert all 0’s into 1’s and all 1’s into 0’s
1’s Complement : Convert all 0’s into 1’s and all 1’s into 0’s. For Example: ’s Complement: 2’s Complement : Convert all 0’s into 1’s and all 1’s into 0’s and then add 1. For Example: (37) 1’s Complement: __________1 2’s Complement: (-37) +

11 BINARY ARITHMETIC: BINARY ADDITION: There are four Basic Rules for Binary Addition: FOR EXAMPLE: 1 1 1 1 1

12 BINARY ARITHMETIC: 0 1 1 0 - 1 1 BINARY SUBTRACTION:
1)There are four Basic Rules for Binary Subtraction: Borrow FOR EXAMPLE: If any, otherwise impossible to solve 1 10 10 1 1

13 BINARY ARITHMETIC: =0101 + (-0011) =0101 + (1100+1) =0101 + 1101
BINARY SUBTRACTION: 2-Use the 2’s complement method: FOR EXAMPLE: (a 4-bit number) A – B can be expressed as A + (-B) (-B) is the 2’s complement of B = (-0011) = (1100+1) = =1 0010 (5) (3) (2)

14 References Mano, (2008). Logic and Computer Design Fundamentals, 4th ed., Prentice-Hall. Mano, (2006),Digital Design, 4th ed, Prentice Hall. Kifer, M., &Smolka, S. A. (2007).Introduction to Operating System Design and Implementation, Springer memory.asp‏ en.wikipedia.org/wiki/Bus_(computing) en.wikipedia.org/wiki/Addressing_mode‏


Download ppt "Computer Architecture CST 250"

Similar presentations


Ads by Google