Digital Logic and Computer Architecture
Digital Logic and Computer Architecture
10/26/2019 3 10/26/2019 4
1
10/26/2019
10/26/2019 7 10/26/2019 8
2
10/26/2019
10/26/2019 9 10/26/2019 10
10/26/2019 11 10/26/2019 12
3
10/26/2019
C=A’B+AB’
10/26/2019 13 10/26/2019 14
4
10/26/2019
Half-Adder Full-Adder
• The most basic digital arithmetic circuit. • A full-adder performs the addition of three binary digits.
• Performs the addition of two binary digits. • Two half-adders can be combined to form a full-adder.
• Full adder has three inputs and two outputs
• The input variables of a half-adder are called the augends
• The full adder circuit contains two half adders and an OR gate.
• The output variables of a half-adder are called the sum (S) and
the carry (C).
half adder
S = x’y+xy’=x ⊕ y
C=xy
10/26/2019 17 10/26/2019 18
Decoder Decoder
• A decoder is a combinational circuit that converts binary
information from the n coded inputs to a maximum of 2n unique Logic Diagram for 3-to-8 Decoder
outputs.
• Consists of: n Inputs and 2n Outputs (numbered from 0 - 2n - 1)
• The truth table of 3-to-8 Decoder is shown below:
10/26/2019 19 10/26/2019 20
5
10/26/2019
10/26/2019 21 10/26/2019 22
4-to-1 multiplexer
10/26/2019 23 10/26/2019 24
6
10/26/2019
• T Flip- Flop
10/26/2019 25 10/26/2019 26
10/26/2019 27 10/26/2019 28
7
10/26/2019
10/26/2019 29 10/26/2019 30
10/26/2019 31 10/26/2019 32
8
10/26/2019
10/26/2019 33 10/26/2019 34
10/26/2019 35 10/26/2019 36
9
10/26/2019
10/26/2019 39 10/26/2019 40
10
10/26/2019
10/26/2019 41 10/26/2019 42
11
10/26/2019
Binary Hexadecimal
10/26/2019 45 10/26/2019 46
10/26/2019 47 10/26/2019 48
12
10/26/2019
= 578 = 3648 Works both ways (Binary to Hex & Hex to Binary)
10/26/2019 51 10/26/2019 52
13
10/26/2019
68 58 18 28 38
Refer to the binary-hexadecimal Refer to the binary-hexadecimal
110 101 001 010 011 conversion table conversion table
0000 0000 0011 01012 0000 0000 0101 00112 1 2 B16 A B D E16
0 0 3 5 0 0 5 3
0001 0010 10112 (12 bits) 1010 1011 1101 11102
= 3516 = 5316
= 0001001010112 = 10101011110111102
octal binary hexadecimal
10/26/2019 53 10/26/2019 54
10/26/2019 55 10/26/2019 56
14
10/26/2019
Examples:
ii) 6 bits binary number
i) 8 bits binary number __ __ __ __ __ __
__ __ __ __ __ __ __ __ 5 bits for magnitude (value)
Sign bit
7 bits for magnitude (value) 0 => +ve 1 => –ve
Sign bit
0 => +ve 1 => –ve a) +7 = 0 0 0 1 1 1
(–7 = 1 0 0 1 1 12)
b) –10 = 1 0 1 0 1 0
a) +7 = 0 0 0 0 0 1 1 1 (+10 = 0 0 1 0 1 02)
(–7 = 100001112)
b) –10 = 1 0 0 0 1 0 1 0
(+10 = 000010102)
10/26/2019 57 10/26/2019 58
10/26/2019 59 10/26/2019 60
15
10/26/2019
10/26/2019 61 10/26/2019 62
Exercise: Exercise:
Obtain representation for the following
• Obtain representation of twos numbers
complement (6 bit) for the Decimal Sign-magnitude Twos complement
following numbers +7
+6
i) +710 ii)–1010 4 bits
-4
Solution: Solution:
-6
= 1101102 -13
So, twos compliment
for –10 is 1101102
10/26/2019 63 10/26/2019 64
16
10/26/2019
10/26/2019 65 10/26/2019 66
10/26/2019 67 10/26/2019 68
17
10/26/2019
10/26/2019 69 10/26/2019 70
10/26/2019 71 10/26/2019 72
18
10/26/2019
10/26/2019 75 10/26/2019 76
19