Question

In: Computer Science

Digital System Design Write the verilog HDL code for 2-4 decoder (Gate level modeling) along with...

Digital System Design

  1. 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.

Solutions

Expert Solution

code:

raw_code :

`timescale 1ns / 1ps
module decoder(a,b,e,D);

input a,b,e; //declaring inputs
output [3:0] D; //declaring output

//gate level implementation of decoder
and a1(D[0],~a,~b,e);
and a2(D[1],~a,b,e);
and a3(D[2],a,~b,e);
and a4(D[3],a,b,e);

endmodule

test_bench:

raw_code :

module test_decoder();
reg a,b,e; //declaring inputs as register
wire [3:0]D;

decoder d(a,b,e,D); //instantiation

initial begin
//Initialize inputs
e = 1;
a = 1'b0; #20;
b = 1'b0; #20;
b = 1'b1; #20;
a = 1'b1; #20;
  
end
endmodule

output :

***do comment for queries and rate me up********


Related Solutions

Write down the VERILOG code for an XOR gate and the testbench code to test it
Write down the VERILOG code for an XOR gate and the testbench code to test it
Code a 2:4 decoder with registered out. Also write a testbench of the decoder.
Code a 2:4 decoder with registered out. Also write a testbench of the decoder.
Design of 4 Bit Adder/Subtractor using Loops (Behavior Modeling Style) (verilog Code) -
Design of 4 Bit Adder/Subtractor using Loops (Behavior Modeling Style) (verilog Code) -
write a verilog code to implement a digital system that has an odd counter that counts...
write a verilog code to implement a digital system that has an odd counter that counts from 1 to 11. Also, this system has an output Y that detects a specific number in the odd counter. Test your code when you detect the number 3, the output Y is 1, if the counter value is set to 3, otherwise 0.
Implement a 4x4 multiplier using gate level (verilog code and test bench)
Implement a 4x4 multiplier using gate level (verilog code and test bench)
Design a 4-bit multiplier by using 4 bit full adder and write a verilog code.
Design a 4-bit multiplier by using 4 bit full adder and write a verilog code.
SYSTEM VERILOG: Using your preferred HDL program, design a complete 4-bit Carry Look Ahead (CLA) adder...
SYSTEM VERILOG: Using your preferred HDL program, design a complete 4-bit Carry Look Ahead (CLA) adder module.
(Write/Design) both the RTL and Testbench using the Verilog HDL language of the five input majority...
(Write/Design) both the RTL and Testbench using the Verilog HDL language of the five input majority using the structure modeling approach. NOTE: Design means RTL code and Testbench covering all possible corner cases
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.
write gate level 4bit carry look ahead adder in verilog without any assign and always in...
write gate level 4bit carry look ahead adder in verilog without any assign and always in the code.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT