Question

In: Electrical Engineering

Create the Decoder module in System Verilog to decode the 4-bit Binary Coded Decimal digit into...

Create the Decoder module in System Verilog to decode the 4-bit Binary Coded Decimal digit into seven-segment code. You can also include and instantiate your decoder schematic from Section 3 instead of writing a new System Verilog module.

Solutions

Expert Solution

VERILOG CODE

module bcd_7segment(BCD,clk, segment);
input [3:0] BCD;
   input clk;   //inputs ABCD
output reg [6:0] segment;   //segments abcdefg

always @ ( posedge clk)
begin
case (BCD)
    4'b0000 : begin segment = 7'b1111110; end   //BCD 0
4'b0001 : begin segment = 7'b0110000; end//BCD 1
4'b0010 : begin segment = 7'b1101101; end   //BCD2
4'b0011 : begin segment = 7'b1111001; end   //3
4'b0100 : begin segment = 7'b0110011; end   //4
4'b0101 : begin segment = 7'b1011011; end   //5
4'b0110 : begin segment = 7'b1011111; end   //6
4'b0111 : begin segment = 7'b1110000; end   //7
4'b1000 : begin segment = 7'b1111111; end       //8
4'b1001 : begin segment = 7'b1110011; end   //9
default : begin segment = 7'b0000000; end   //default 0
endcase
end
endmodule


Related Solutions

Create the Parser module in System Verilog to convert the 8-bit Button Board input into four...
Create the Parser module in System Verilog to convert the 8-bit Button Board input into four 4-bit Binary Coded Decimal numbers. The parser should read in an 8-bit Button Board input as an 8-bit number (0-255). Parse that 8-bit number into four 4-bit numbers (0-9) representing its ones, tens, hundreds, and thousands digit.
Question B Write an 8 bit adder module in System Verilog by appropriately connecting two 4...
Question B Write an 8 bit adder module in System Verilog by appropriately connecting two 4 bit adders (the System Verilog code of a 4 bit adder is available in the lecture notes). Instantiate your 8 bit adder module on DE2 board. Design a test circuit on DE2 board that allows us to test the 8 bit adder using the switches and the seven segment displays on DE2 board. The test circuit will need the module you designed for Part...
Design a Decoder Circuit that can convert a 4-bit Binary Number to a Hexadecimal Output.
Design a Decoder Circuit that can convert a 4-bit Binary Number to a Hexadecimal Output.
Design a 9’s complement of a Binary Coded Decimal
Design a 9’s complement of a Binary Coded Decimal
Model a BCD to 7-Segment Decoder (1111 1000) Create a top-level Verilog module, named bcdto7segment_dataflow with...
Model a BCD to 7-Segment Decoder (1111 1000) Create a top-level Verilog module, named bcdto7segment_dataflow with 4-bit data input (x[3:0]), anode enable output signals (an[3:0]), and 7-bit output (seg[6:0]) using dataflow modeling (Hint: You will have to derive seven expressions for the 7 segments on paper). Assign appropriate logic to an[3:0] in the model so you can display only on the right most display.
You are using a poorly constructed 4-bit natural binary-coded absolute encoder and observe that
You are using a poorly constructed 4-bit natural binary-coded absolute encoder and observe that, as the encoder rotates through the single step from code 3 to code 4, the encoder outputs several different and erroneous values. If misalignment between the photosensors and the code disk is the problem, what possible codes could result during the code 3-to-4 transition?
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a Verilog module that implements a certain 4-bit counter. The module should include two more input variables: “updown” and “count2”. If “updown” is 1, the circuit should count up (by 1s); if it is 0 it should count down (by 1s). If “count2” has a value of 1, the circuit should instead count up by 2s; otherwise it will have no effect (the circuit counts...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a Verilog module that implements a certain 4-bit counter. The module should include two more input variables: “updown” and “count2”. If “updown” is 1, the circuit should count up (by 1s); if it is 0 it should count down (by 1s). If “count2” has a value of 1, the circuit should instead count up by 2s; otherwise it will have no effect (the circuit counts...
Implement 4-bit binary adder/subtractor using gate level. ( verilog code and test bench)
Implement 4-bit binary adder/subtractor using gate level. ( verilog code and test bench)
Digital System Design Write the verilog HDL code for 2-4 decoder (Gate level modeling) along with...
Digital System Design Write the verilog HDL code for 2-4 decoder (Gate level modeling) along with the testbench and simulate using ModelSim. Upload the assignment (i) code (ii) testbench (iii) simulation in single pdf file.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT