Chapter 01
Chapter 01
Chapter 01
Dr.Ahmed Awad
Overview
° Digital systems
° Understanding decimal numbers
° Binary and octal numbers
• The basis of computers!
° Digital age.
° Applications:
• Communications.
• Business transactions.
• Medical treatment
• ….
• Digital computers.
2 22=4 10 210=1024
3 23=8 11 211=2048
4 24=16 12 212=4096
5 25=32 20 220=1M
Mega
6 26=64 30 230=1G
Giga
AND Gate
1
0
0
Conversion Between Number Bases
Octal(base 8)
Hexadecimal
(base16)
° Learn to convert between bases.
° Already demonstrated how to convert
from binary to decimal.
° Hexadecimal described in next
lecture.
Convert an Integer from Decimal to Another Base
1 11 1 1 1 carries
11 1 1 0 1
+ 1 0 1 1 1
---------------------
1 0 1 0 1 0 0
Binary Subtraction
1 10 borrows
0 10 10 0 0 10
1 0
0 1 1 0 1
- 1 0 1 1 1
------------------------
1 1 0 1 1 0
Binary Multiplication
10 1 1 1
X 1 0 1 0
-----------------------
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0
Convert an Integer from Decimal to Octal
0.3125 x 8 = 2 + 5 a-1 = 2
0.5000 x 8 = 4 + 0 a -2 = 4
° Why binary?
Understanding Binary Numbers
° Conversion is easy!
Determine 4-bit value for each hex digit
° Note that there are 24 = 16 different values of four
bits
° Easier to read and write in hexadecimal.
° Representations are equivalent!
Converting Between Base 16 and Base 8
M-N
Subtraction with Complements
Subtraction with Complements
Arithmetic Addition
Arithmetic Addition
2’s Complement Addition
° Using 2’s complement numbers, adding numbers
is easy.
° For example, suppose we wish to add +(1100)2
and +(0001)2.
° Let’s compute (12)10 + (1)10.
• (12)10 = +(1100)2 = 011002 in 2’s comp.
• (1)10 = +(0001)2 = 000012 in 2’s comp. 0 1 1 0 0
Add + 0 0 0 0 1
Step 1: Add binary numbers --------------
Step 2: Ignore carry bit Final 0 0 1 1 0 1
Result
Ignore
2’s Complement Subtraction
° Using 2’s complement numbers, follow steps for
subtraction
° For example, suppose we wish to subtract
+(0001)2 from +(1100)2.
0 1 1 0 0
° Let’s compute (12)10 - (1)10. - 0 0 0 0 1
• (12)10 = +(1100)2 = 011002 in 2’s comp. --------------
• (-1)10 = -(0001)2 = 111112 in 2’s comp.
2’s comp
0 1 1 0 0
Step 1: Take 2’s complement of 2nd operand Add + 1 1 1 1 1
Step 2: Add binary numbers --------------
Step 3: Ignore carry bit Final
Result 1 0 1 0 1 1
Ignore
Carry
2’s Complement Subtraction: Example #2
° ASCII Codes
° A – Z (26 codes), a – z (26 codes)
° 0-9 (10 codes), others (@#$%^&*….)
° Complete listing in Mano text
° Transmission susceptible to noise
° Typical transmission rates (1500 Kbps, 56.6 Kbps)
° How to keep data transmission accurate?
Binary Data Storage
0 0 1 0 1 0 1 1
Binary Cell
Register Transfer
Register A Register B
Digital Logic
Circuits
Register C
Transfer of Information