Digital Logic Design: Dr. M. Najam Ul Islam PHD Electrical Engineering
Digital Logic Design: Dr. M. Najam Ul Islam PHD Electrical Engineering
Digital Logic Design: Dr. M. Najam Ul Islam PHD Electrical Engineering
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) Easy to represent binary values electrically Voltages and currents. Can be implemented using circuits Create the building blocks of modern computers
3
Decimal
Most people today use decimal representation to count. In the
decimal system there are 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example 1: Consider the number 1234. It can be represented as 1*10+ 2*10 + 3*10 + 4*10 Where: 1 is in the thousands place 2 is in the hundreds place 3 is in the tens place 4 is in the ones place. Important note: any number in power of zero is 1, even zero in power of zero is 1.
4
Where:
5 is in the 1/10th place 6 is in the 1/100th place 7 is in the 1/1000th place
For example:
Consider the binary number 1101. It can be represented as
1*2+ 1*2 +0*2 + 1*2
In decimal:
8 + 4 + 0 + 1 = 13
Binary Addition Binary addition is very simple. This is best shown in an example of adding two binary
numbers
1
1
carries
1 1 1 0 1 + 1 0 1 1 1 --------------------1 0 1 0 1 0 0
2
3 4 5 6 7
10
22=4
23=8 24=16 25=32 26=64 27=128
10
11 12 20 30 40
210=1024
211=2048 212=4096 220=1M 230=1G 240=1T
11
(0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F) How many items does a hex number represent? (3A9F)16 = 3x163 + 10x162 + 9x161 + 15x160 = 15,00710 What about fractions? (2D3.5)16 = 2x162 + 13x161 + 3x160 + 5x16-1 = 723.312510 Note that each hexadecimal digit can be represented with four bits. (1110)2 = (E)16 Groups of four bits are called a nibble. (1110)2
12
13
6 3 1 0
+ + + +
a0 = 1 a1 = 0 a2 = 1 a3 = 1
1 0 1
+ + +
0.25 0.50 0
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!
16
352378 =
Convert from Base 16 to Base 2 Regroup bits into groups of three starting from right Ignore leading zeros Each group of three bits forms an octal digit.
17
0111
18
BCD Addition
19
Decimal 1 2 3 4
Decimal 5 6 7 8
Decimal 9 10 11 12
Gray Coding The reflected binary code, also known as Gray code after
Frank Gray, is a binary numeral system where two successive values differ in only one bit.
21
Decimal
0 1 2 3 4 5
Binary
0000 0001 0010 0011 0100 0101
Gray-Code.
0000 0001 0011 0010 0110 0111
6
7 8 9 10 11 12 13 14
22
0110
0111 1000 1001 1010 1011 1100 1101 1110 1111
0101
0100 1100 1101 1111 1110 1010 1011 1001 1000
15
23
24
25
26