Logika Kombinasi
Logika Kombinasi
Overview
Design Procedure Code Converters Binary Decoders
Design Procedure
5. 1. 2.
3.
4.
ts Det and outputs and assign variables to them. erm Derive the truth table that defines the ine required relationship between inputs and outputs. the Obtain and simplify the Boolean function (Kreq maps, algebraic manipulation, CAD tools, ). Consider any design constraints (area, delay, uire power, available libraries, etc). d Draw the logic diagram. num Verify the correctness of the design. ber of inpu
Design Example
Design a combinational circuit with 4 inputs that generates a 1 when the # of 1s equals the # of 0s. Use only 2-input NOR gates
BCD-to-Seven-Segment Converter
Example: n=5 n+3=8 1000excess-3 n=0 n+3=3 0011excess-3 We need 4 input variables (A,B,C,D) and 4 output functions W(A,B,C,D), X(A,B,C,D), Y(A,B,C,D), and Z(A,B,C,D).
Seven-segment display:
7 LEDs (light emitting diodes), each one controlled by an input a 1 means on, 0 means off b g
Set a, b, c, d, g to 1
Set e, f to 0
Display digit 3?
BCD-to-Seven-Segment Converter
Input is a 4-bit BCD code 4 inputs (w, x, y, z). Output is a 7-bit code (a,b,c,d,e,f,g) that allows for the decimal equivalent to be displayed. a
f b
CD
O ut Example: pu t: 11
4 5 6
0111
11100X0
1111
XXXXXXX
??
Decoders
A combinational circuit that converts binary information from n coded inputs to a maximum 2n decoded outputs n-to- 2n decoder
n-to-m decoder, m = 2n
ecoders (cont.)
to-4 Decoder
daatdata
3-to-8 Decoder
adderssaddress
A onal circuit can be constructed using decoders and OR gates! Why? n Here is an example: y Implement a full adder circuit with a decoder and two OR gates. c Recall full adder equations, and let X, Y, and Z o be the inputs: m Since there are 3 inputs and a total of 8 bi minterms, we need a 3-to-8 decoder. n a ti
S(X,Y,Z) = X+Y+Z = m(1,2,4,7) C (X,Y,Z) = m(3, 5, 6, 7).
Decoder Expansions
Larger decoders can be constructed using a number of smaller ones. -> HIERARCHICAL design! Example: A 6-to-64 decoder can be designed using four 4-to-16 and one 2-to-4 decoders. How? (Hint: Use the 2-to-4 decoder to generate the enable signals to the four 4-
to-16 decoders).
Encoders
An encoder is a digital circuit that performs the inverse operation of a decoder. An encoder has 2n input lines and n output lines. The output lines generate the binary equivalent of the input line whose value is 1.
Encoders (cont.)
Encoder Example
Example:
A0 = D1 + D3 + D5 + D7
A1 = D2 + D3 + D6 + D7 A2 = D4 + D5 + D6 + D7
There are two ambiguities associated with the design of a simple encoder:
1.
Only one input can be active at any given time. If two inputs are active simultaneously, the output produces an undefined combination (for example, if D3 and D6 are 1 simultaneously, the output of the encoder will be 111. An output with all 0's can be generated when all
2.
Priority Encoders
Solves the ambiguities mentioned above. Multiple asserted inputs are allowed; one has priority over all others. Separate indication of no asserted inputs.
7 1 4 0 2 5
8 A 3 6
9 B F E D C
R0 R1 R2 R3
COL. 4-bit
1 4 7
2 5 8
3 6 9
F E D
ROW 4-bit
Interrupt Encoder
Microprocessor
Device B
Req(1:0)
Device C
Device D IntRq
0 0 0
0 0 1
1 1 0
0 1 0
01 01 10
1 1 1