Académique Documents
Professionnel Documents
Culture Documents
ECE-2003
PROF: SAKTHIVEL R
Consider that three input message along with even parity bit is generated at the transmitting end.
These 4 bits are applied as input to the parity checker circuit which checks the possibility of error on
the data. Since the data is transmitted with even parity, four bits received at circuit must have an
even number of 1s.
If any error occurs, the received message consists of odd number of 1s. The output of the parity
checker is denoted by PEC (parity error check).
The below table shows the truth table for the even parity checker in which PEC = 1 if the error
occurs, i.e., the four bits received have odd number of 1s and PEC = 0 if no error occurs, i.e., if the
4-bit message has even number of 1s.
The above truth table can be simplified using K-map as shown below.
The above logic expression for the even parity checker can be implemented by using three Ex-OR
gates as shown in figure. If the received message consists of five bits, then one more Ex-OR gate is
required for the even parity checking.
VERILOG CODE :
module Even_Parity_Checker_4 (output C, input x, y, z, p);
xor(w1, x, y);
xor(w2, z, p);
xor(C, w1, w2);
endmodule
Q 2) Write a Verilog model of a circuit whose 32-bit output is formed by shifting its 32-bit
input three positions to the right and filling the vacant positions with the bit that was in the
MSN before the shift occurred (shift arithmetic right).Write a Verilog model of a circuit
whose 32-bit output is formed by shifting its 32-bit input three positions to the left and
filling the vacant positions with 0 (shift logical left). (3Marks).
Soln:
Shiftright_by_3:
Soln:
Step 1: The first step of the design involves analysis of the common cathode 7-segment display. A
7-segment display consists of an arrangement of LEDs in an ‘H’ form. A truth table is constructed
with the combination of inputs for each decimal number. For example, decimal number 1 would
command a combination of b and c (refer the diagram given below).
7 Segment LED
Step 2: The second step involves constructing the truth table listing the 7 display input signals,
decimal number and corresponding 4 digit binary numbers.
The truth table for the decoder design depends on the type of 7-segment display. As we mentioned
above that for a common cathode seven-segment display, the output of decoder or segment driver
must be active high in order to glow the segment.
The figure below shows the truth table of a BCD to seven-segment decoder with common cathode
display. In the truth table , there are 7 different output columns corresponding to each of the 7
segments.
Suppose the column for segment a shows the different combinations for which it is to be
illuminated. So ‘a’ is active for the digits 0, 2, 3, 5, 6, 7, 8 and 9.
From the above truth table, the Boolean expressions of each output functions can be written as
a = F1 (A, B, C, D) = ∑m (0, 2, 3, 5, 7, 8, 9)
b = F2 (A, B, C, D) = ∑m (0, 1, 2, 3, 4, 7, 8, 9)
c = F3 (A, B, C, D) = ∑m (0, 1, 3, 4, 5, 6, 7, 8, 9)
d = F4 (A, B, C, D) = ∑m (0, 2, 3, 5, 6, 8)
e = F5 (A, B, C, D) = ∑m (0, 2, 6, 8)
f = F6 (A, B, C, D) = ∑m (0, 4, 5, 6, 8, 9)
g = F7 (A, B, C, D) = ∑m (2, 3, 4, 5, 6, 8, 9)
Step 3: The third step involves constructing the Karnough’s map for each output term and then
simplifying them to obtain a logic combination of inputs for each output.
K-Map Simplification
The below figures shows the k-map simplification for the common cathode seven-segment decoder
in order to design the combinational circuit.
From the above simplification, we get the output values as
VERILOG CODE: