Combinational Logic Functions Decoder Encoder Multiplexer Demultiplexer Magnitude Comparator Parity Generator and Checker
Encoders
Encoder: A digital circuit that generates a specific code at its outputs in response to one or more active inputs. It is complementary in function to a decoder. Output codes are usually Binary or BCD.
3
Priority Encoders
Priority Encoder: An encoder that generates a code based on the highestpriority input. For example, if input D3 = input D5, then the output is 101, not 011. D5 has a higher priority than D3 and the output will respond accordingly.
4
Q2 = D7 + D6 + D5 + D4 Q1 = D7 + D6 + D5 D4 D3 + D5 D4 D2 Q0 = D7 + D6 D5 + D6 D4 D3 + D6 D4 D2 D1
q(0) END a;
<=
12
S0 0 1 0 1
Y D0 D1 D2 D3
14
Multiplexer Logic
Boolean expression for a 4-to-1 MUX is Y = D0 S1 S0 + D1 S1 S0 + D2 S1 S0 + D3 S1 S0 This expression can be expanded to any size MUX so the VHDL architecture could use a very long concurrent Boolean statement.
15
16
S0
0 1 0 1
Y3 Y2 Y1 Y0 D03 D02 D01 D00 D13 D12 D11 D10 D23 D22 D21 D20 D33 D32 D31 D30
17 18
19
Case Statement
A case statement is a sequential VHDL construct in which there is a choice of statements to be executed, depending on the value of a signal or variable.
CASE __expression IS WHEN __constant_value => __statement; __statement; WHEN __constant_value => __statement; __statement; WHEN OTHERS => __statement; __statement; END CASE;
21
22
Board Work
Modify the VHDL from the previous example to implement a 8-to-1 mux. Implement the following truth table using a 4-to-1 mux:
AB 00 01 10 11
23
Z 0 1 0 1
24
Homework
Chapter 6
16 18 20 24 25 (BCD Priority Encoder) a (BCD Priority Encoder) (Multiplexer) (Multiplexer Truth table) a (Multiplexer VHDL)
26