Part III Figure 6 shows a 7-segment decoder module that has the two-bit input c1
ID: 1716239 • Letter: P
Question
Part III Figure 6 shows a 7-segment decoder module that has the two-bit input c1c0. This decoder produces seven outputs that are used to display a character on a 7-segment display. Table 1 lists the characters that should be displayed for each valuation of c1c0. Three characters are included plus the blank' character, which is selected for code 11. 5 6 7-segment Figure 6: A simple 7-segment decoder Table 1-Character Codes Input Output Character C1 CO 0 The seven segments in the display are identified by the indices 0 to 6 shown in the figure. Each segment is illuminated by driving it to the logic value 0. You are to write a Verilog module that implements logic functions that represent circuits needed to activate each of the seven segments. Use only simple Verilog assign statements in your code to specify each logic function using a Boolean expressionExplanation / Answer
module segment7dec (output reg [6:0] HEX0, input [1:0] C);
always @* begin
case(C)
2'b0000: HEX0 = 7'b0100001;
2'b0001: HEX0 = 7'b0000110;
2'b0010: HEX0 = 7'b1111001;
2'b0011: HEX0 = 7'b1111111;
default: HEX0 = 7'b1111111;
endcase
HEX0 = ~HEX0;
end
endmodule