Ch1 DLD 123
Ch1 DLD 123
Alemu W.
[email protected]
05 October 2017 EC.
Contents
Digital Systems
Digital and Analogue Quantities
Binary Digit Logic Level
Digital Waveform
Alemu W.
[email protected]
05 October 2017 EC.
Contents
Decimal Number
Binary Number
Binary Conversation
Hexadecimal Number
Octal Number
1’s and 2’s Compliment
BCD
Quotient Remainder
Quotient Remainder 21 = 10 1
11 = 5 1 2
2
10 = 5 0
5 = 2
2 1
2
5 = 2 1
2 = 2
1 0
2 2 = 1 0
2
1 = 0 1
2 1 = 0 1
10112 = 1110 2
101012 = 2110
(a) 1110
(b) 21 10
Let us perform the addition of two decimal numbers -7 and -4 using 2’s
complement method
• The 2’s complement representation of -7 and -4 with 5 bits: −710= 110012 and
−410 =111002
• The addition of these two numbers is −710 + −410 =110012 + 111002
−710 +−410 =1101012
• The resultant sum contains 6 bits. In this case, carry is obtained from sign bit.
So, we can remove it
• The resultant sum after removing carry is −710 + −410 = 101012
• The sign bit ‘1’ indicates that the resultant sum is negative. So, by taking 2’s
complement of it we will get the magnitude of resultant sum as 11 in decimal
number system.
Therefore, addition of two negative numbers will give another negative
number.
8 4 2 1 code
The weights of this code are 8, 4, 2 and 1.
This code has all positive weights. So, it is a positively weighted code.
This code is also called as natural BCD code
2 4 2 1 code
The weights of this code are 2, 4, 2 and 1
This code has all positive weights. So, it is a positively weighted code.
It is an unnatural BCD code. Sum of weights of unnatural BCD codes is
equal to 9.
It is a self-complementing code. Self-complementing codes provide the 9’s
complement of a decimal number, just by interchanging 1’s and 0’s in its
equivalent 2421 representation.
8 4 -2 -1 code
The weights of this code are 8, 4, -2 and -1
This code has negative weights along with positive weights. So, it is a
negatively weighted code
It is an unnatural BCD code
It is a self-complementing code
Excess 3 code
This code doesn’t have any weights. So, it is an un-weighted code.
We will get the Excess 3 code of a decimal number by adding three to the
binary equivalent of that
decimal number. Hence, it is called as Excess 3 code.
It is a self-complementing code
Gray Code
This code doesn’t have any weights. So, it is an un-weighted code.
In the above table, the successive Gray codes are differed in one bit
position only. Hence, this code is called as unit distance code
Decimal Binary Gray Decimal Binary Gray
0 0000 0000 9 1001 1101
1 0001 0001 10 1010 1111
2 0010 0011 11 1011 1110
3 0011 0010 12 1100 1010
4 0100 0110 13 1101 1011
5 0101 0111 14 1110 1001
6 0110 0101 15 1111 1000
7 0111 0100
8 1000 1100
Parity Code
It is easy to include append one parity bit either to the left of MSB or to the
right of LSB of original bit stream.
There are two types of parity codes, namely even parity code and odd
parity code based on the type of parity being chosen.
Even Parity Code: The value of even parity bit should be zero, if even
number of ones present in the binary code. Otherwise, it should be one.
Even parity code contains the data bits and even parity bit.
Binary Code Even Parity Bit Even Parity Code
0000 0 0000
0001 1 0011
0010 1 0101
0011 0 0110
Even parity bit is useful only for detection of error in the received parity
code. But, it is not sufficient to correct the error
Alemu W.
[email protected]
05 October 2017 EC.
Contents
The inverter
The AND gate
The OR gate
The NAND gate
The NOR gate
The Exclusive OR and Exclusive NOR gates
Practical Examples:
The sensors of the alarm detection system produce a HIGH voltage when
open and a LOW voltage when closed.
As long as the windows and doors are closed, the switches are also closed
which means there is no intrusion and so the system is secure. And all the
inputs are therefore LOW. When any one of the windows or doors is
opened, a HIGH input is given and a HIGH output results and hence it
activates the alarm system.
Algebraic Notation: Z= X+Y
Logic symbol of OR gate:
Truth Table: X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
Application:
It allows and inhibits the passage of the signal at certain times
• That is we can say that the AND gate works as an enable gate at certain times
and the Inhibitor gate at other times.
The main AND gate application is in digital electronics and in data
transmission. Where AND gate helps for allowing or not allowing the data
through a channel.
Automatic temperature-regulating circuits
Freezer warning buzzer devices