Digital Logic Design: Ali Saleh
Digital Logic Design: Ali Saleh
Ali Saleh
Numbering Systems
Digital Computer
Systems
• Digital systems consider discrete amounts of data.
• Examples
– 26 letters in the alphabet
– 10 decimal digits
• Larger quantities can be built from discrete values:
– Words made of letters
– Numbers made of decimal digits (e.g. 239875.32)
• Computers operate on binary values (0 and 1)
• Easy to represent binary values electrically
– Voltages and currents.
– Can be implemented using circuits
– Create the building blocks of modern computers
Hexadecimal
(base16)
° Learn to convert between bases.
1 6 2 . 3 7 5 Digits
100 10 1 1/10 1/100 1/1000 Weights
• These weights are all powers of the base, which is 10. We can rewrite
this:
1 6 2 . 3 7 5 Digits
102 101 100 10-1 10-2 10-3 Weights
• To find the decimal value of a number, multiply each digit by its weight
and sum the products.
261.3516 = 2 6 1 . 3 516
= 0010 0110 0001 . 0011 01012
8 7 C 9
x 16
128
+ 7
135
x 16
2,160
+ 12
2,172
x 16
34,752
+ 9
34,761
34,76110 = 87C916
100101012 = ? (decimal)
149
85710 = ?16
559
BED16 = ?2
1011 1110 1101
1 1 1 1 1
1 carries
1
1 1 1 0 1
+ 1 0 1 1 1
---------------------
1 0 1 0 1 0 0
1 1 1 0 (Carries)
1 0 1 1 (Augend)
+ 1 1 1 0 (Addend)
1 1 0 0 1 (Sum)
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
Subtract by adding
73 73
-35 10’s complement +65
38 138
Ignore carry
Subtract by adding
73 01001001 73 01001001
-35 1 10111 01 35 00100011
38 00100110 2’s comp 11011100 flip
+1
-----------
-35 11011101
4-bit: 8H = -8 to 7H = +7
1000 to 0111
1 0 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
Q1:
What is relationship between a decimal digit (0, 1, …) and
its ASCII code?
Digital Logic Design - Ali Saleh 32
ASCII Properties (2)
Q2:
What is the difference between an upper-case letter
(A, B, …) and its lower-case equivalent (a, b, …)? ASCI CODE
Digital Logic Design - Ali Saleh 33
BCD
0 0000 5 0101
1 0001 6 0110
2 0010 7 0111
3 0011 8 1000
4 0100 9 1001
• Binary coded decimal (BCD) represents each decimal digit with four bits
– Ex. 0011 0010 1001 = 329BCD
3 2 9