Professional Documents
Culture Documents
A B A B
A B A B
A B A B
A B A B
DeMorgan
• DeMorgan’s Laws
– Example: Implement the expression A.B + C.D
using only NAND gates
.
Functional Blocks
• Fundamental circuits that are the base building
blocks of most larger digital circuits
• They are reusable and are common to many systems.
• Examples of functional logic circuits
– Decoders
– Encoders
– Code converters
– Multiplexers
7
Where they are used
• Multiplexers
– Selectors for routing data to the processor, memory, I/O
– Multiplexers route the data to the correct bus or port.
• Decoders
– are used for selecting things like a bank of memory and then
the address within the bank. This is also the function
needed to ‘decode’ the instruction to determine the
operation to perform.
• Encoders
– are used in various components such as keyboards.
8
Specifications step
10
Last 3 steps
• Best illustrated by example
– A BCD to Excess-3 code converter
– BCD-to-7-segment decoder
11
BCD-to-Excess-3 Code converter
• BCD is a code for the decimal digits 0-9
• Excess-3 is also a code for the decimal
digits
12
• 9-6 = 1001......1001
• = 1100
0110
0011
• 8-5 = 1011.....1000
0111
0010
1
0011
Specification of BCD-to-Excess3
15
Formulation of BCD-to-Excess-3
16
Expressions for W X Y Z
• W(A,B,C,D) = Σm(5,6,7,8,9)
+d(10,11,12,13,14,15)
• X(A,B,C,D) = Σm(1,2,3,4,9)
+d(10,11,12,13,14,15)
• Y(A,B,C,D) = Σm(0,3,4,7,8)
+d(10,11,12,13,14,15)
• Z(A,B,C,D) = Σm(0,2,4,6,8)
+d(10,11,12,13,14,15)
17
BCD-to-Seven-Segment Decoder
• Specification
– Digital readouts on many digital products often
use LED seven-segment displays.
– Each digit is created by lighting the appropriate
segments. The segments are labeled
a,b,c,d,e,f,g
– The decoder takes a BCD input and outputs the
correct code for the seven-segment display.
18
Specification
• Input: A 4-bit binary value that is a BCD
coded input.
• Outputs: 7 bits, a through g for each of the
segments of the display.
• Operation: Decode the input to activate the
correct segments.
19
Formulation
• Construct a truth table
20
4-bit Equality Checker
• Specification
– Input: Two vectors, A(3:0) and B(3:0) each
being 4-bits. The msb bits the A(3) and B(3).
– Output: E which has a value of 1 when A=B
and 0 if any bit of A/=B.
– Operation: Combinational logic to compare the
4 bits of A with the 4 bits of B to produce E
21
4-bit Equality Checker
• Formulation
– For each bit position Ai will be compared with
Bi and if they are equal, a 0 will be output. If
they differ a 1 will be output.
– Thus, if any bit position indicates a 1 then the
values are different. These 1st level
comparators outputs can then be Ored together.
– The ORed output is inverted to produce a 1
when they are equal.
22
4-bit Equality Checker
• Optimization
• Done by implementing
two separate blocks.
• 1st the unit MX that
compares two bit and
outputs a 0 if they are
equal, i.e., an XOR
operation.
23
Encoder/Decoder Vocabulary
0 0 0 O0
0 0 1 O1
0 1 0 O2
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
A3 A2 A1 A0 A B C D E F G
0 0 0 0 1 1 1 1 1 1 0
0 0 0 1 0 1 1 0 0 0 0
0 0 1 0 1 1 0 1 1 0 1
0 0 1 1 1 1 1 1 0 0 1
0 1 0 0 0 1 1 0 0 1 1
0 1 0 1 1 0 1 1 0 1 1
0 1 1 0 1 0 1 1 1 1 1
0 1 1 1 1 1 1 0 0 0 0
1 0 0 0 1 1 1 1 1 1 1
1 0 0 1 1 1 1 1 0 1 1
THE 8421 BCD CODE
• BCD stands for Binary-Coded Decimal.
Example:
Decimal number 4926 4 9 2 6
35
74x148 8-input priority encoder
36
74x148 8-input priority encoder
– Active-low I/O
– Enable Input
– “Got Something": Group Select
– Enable Output 37
74x148 Truth Table
38
74x148
circuit
39
4 line to 10 line Decoder
DECIMAL
9
8
DECODER 7
74LS42
BINARY (BCD) 9 6
8
7 5
6
5
8 0V 4 4
A3 3
4 0V A2 2
2 0V
A1
A0
1
0
3
1 0V 2
1
0
Display 7 Segment
Type :
1. Common Anoda
2. Common Cathoda
DECODERS: BCD TO
7-SEGMENT DECODER/DRIVER
BCD input Decimal output
LED
01
0010
1
BCD-to-
7-Segment
Decoder/
Driver
BCD input
Decimal output
010 100 010
1 011
0
BCD-to-
7-Segment
Decoder/
Driver ?
BCD-TO-SEVEN SEGMENT DECODER DRIVER
V+
abcdef g .
74LS47
A3 g
A2 f
A1 e
A0 d
c
b
a
5V
test
RBI RBO
TEST
A 0 O 0
A 1 O 1
A O
2 2 INPUT O3 O2 O1 O0
A 3 ENCODER O 3 A1=1
A 4
A4=1
A A6=1
5
A8=1
A 6
A 7
A 8
A 9
TEST
A 0 O 0
A 1 O 1
A 2 O 2 A3 A2 A1 A0 OUTPUT
A 3 DECODER O 3
0 0 0 0
O 0 1 0 1
4
O 0 1 1 1
5
1 0 0 1
O 6
O 7
O 8
O 9
TEST
ANSWER THE FOLLOWING QUESTIONS WITH ONE OR MORE
OF THESE WORDS: MUX, DEMUX, ENCODER, DECODER.
A. Has more inputs than outputs. ENCODER, MUX
Encoder dari 8 ke 3 D0 0 0 0
– Buat Tabel
D1 0 0 1
Kebenaran
D2 0 1 0
– Tentukan
persamaan Output D3 0 1 1
nya D4 1 0 0
• O2 = ?
D5 1 0 1
• O1 = ?
D6 1 1 0
• O0 = ?
D7 1 1 1
– Rangkaiannya ?
Latihan 2
• Rancang rangkaian Input Output
I2 I1 I0
Dekoder dari 3 ke 8 0 0 0 O0
– Buat Tabel 0 0 1 O1
kebenarannya 0 1 0 O2
– Tentukan Persamaannya 0 1 1 O3
1 0 0 O4
– Buat rangkaiannya
1 0 1 O5
1 1 0 O6
1 1 1 O7
Soal
• Rancanglah rangkaian Decoder BCD ke
Display Seven Segment.