a) Write a Verilog module that implements a 1-bit partial full adder (PFA).
b) Through instantiating the module in a) plus other logic, implement a 4-bit full adder with Verilog.
c) Write a proper test-bench and stimulus, thoroughly test your 4 bit carry lookahead adder.
d) Show a waveform snapshot that indicates you adder can correctly compute 0101 + 1101 and show your results.




(D)..

(A)..you can see simple 1 bit full adder below,
module full_adder(a,b,cin,sum,carry);
input a,b,cin;
output sum,carry;
assign sum=a^b^cin;
assign carry=((a&b)|(b&cin)|(a&cin));
(B)..using this adder we will develop 4 bit carry look ahed adder,
you can see the code of carry look ahed adder below,
module carry_lookahed_addr(a,b,sum_out,carry_out);
input [3:0]a,b;
wire [4:0]cin_w;//it has 4 bit carry pin
output [4:0]sum_out;// result of sum
output carry_out;
wire [3:0]sum;// we have used 3 internal wire for instantiation and calculation of carry generation and propagation
wire [3:0]carry_generate,carry_propagate;
full_adder d1(.a(a[0]),.b(b[0]),.cin(cin_w[0]),.sum(sum[0]),.carry());// for 4 bit adder we have instantiate 1 bit adder 4 times
full_adder d2(.a(a[1]),.b(b[1]),.cin(cin_w[1]),.sum(sum[1]),.carry());
full_adder d3(.a(a[2]),.b(b[2]),.cin(cin_w[2]),.sum(sum[2]),.carry());
full_adder d4(.a(a[3]),.b(b[3]),.cin(cin_w[3]),.sum(sum[3]),.carry());
assign carry_generate[0]=a[0]&b[0];// equation for carry generation C_G=a&b,
assign carry_generate[1]=a[1]&b[1];
assign carry_generate[2]=a[2]&b[2];
assign carry_generate[3]=a[3]&b[3];
assign carry_propagate[0]=a[0]^b[0];
assign carry_propagate[1]=a[1]^b[1];
assign carry_propagate[2]=a[2]^b[2];
assign carry_propagate[3]=a[3]^b[3];
assign cin_w[0] = 0; // no carry input
assign cin_w[1] = carry_generate[0] | (carry_propagate[0] & cin_w[0]);
assign cin_w[2] = carry_generate[1] | (carry_propagate[1] & cin_w[1]);
assign cin_w[3] = carry_generate[2] | (carry_propagate[2] & cin_w[2]);
assign cin_w[4] = carry_generate[3] | (carry_propagate[3] & cin_w[3]);
assign sum_out={cin_w[4],sum};
assign carry_out=cin_w[4];
(C).you can see test bench for 4 bit carry look ahed adder
module top;
reg[3:0]a,b;//for test bench input will be reg
wire [4:0]sum_out; //output will be wire
wire carry_out;//output will be wire
carry_lookahed_addr dut(.a(a),.b(b),.sum_out(sum_out),.carry_out(carry_out));//instantiation of 4 bit carry look ahed adder design
initial begin
a=0;
b=0;
#10;
a=4'd14;
b=4'd12;
#10;
a=4'd3;
b=4'd3;
#10;
a=4'd3;
b=4'd5;
#10;
a=4'd11;
b=4'd3;
#10;
a=4'd7;
b=4'd5;
#10;
a=4'd3;
b=4'd4;
#200;
$finish;
end
please drop here a comment if u have any doubts..Thank you..please like
a) Write a Verilog module that implements a 1-bit partial full adder (PFA). b) Through instantiating...
Design an 8-bit full adder using Verilog (Use only 1-bit full adders). Write the design code, test-bench code of it, and test your design with six inputs. Note: Only use Verilog to design 8-bit full adder.
1. Write a Verilog module called myNot to implement the logic NOT gate. 2. Write a test bench to test the myNot module created in step 10. Simulate the circuit using Sim and analyze the resulting waveform. 3. Take full screenshots of the source code of myNot module, the test bench Verilog file, and resulting simulation waveforms to be included in the lab report. Also include your waveform analysis in the lab report.
Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write a proper test-bench and stimulus, thoroughly test your J-K-FlipFlop. Also, show your waveform and describe why your JK-FF does what is is designed to do. Problem 2. a) Write a Verilog module that will assert its output if a 4-bit input binary word is even. b) Show the waveform for two input patterns “1100” and “0101”
Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write a proper test-bench and stimulus, thoroughly test your J-K-FlipFlop. Also, show your waveform and describe why your JK-FF does what is is designed to do. Problem 2. a) Write a Verilog module that will assert its output if a 4-bit input binary word is even. b) Show the waveform for two input patterns “1100” and “0101”
Write a Verilog module that implements the following Boolean equation: f1 = a * b * c' + a * c + b * c Simplify the above expression; write another module to implement it as f2. Write a test bench to check whether f1 and f2 are identical with different values of a, b and c.
Write the Verilog HDL textfixture stimulus code for an 4 bit binary full adder
Model the following using Structural Verilog and write a Test Bench. a. Half adder b. Full adder c 4 1 Multiplexer d. 2-to-4-Line Decoder 2. Model the following using Behavioral Verilog and write a Test Bench. a. Half adder b. 4-bit Up counter c. Positive edge triggered D Flip Flop d. Positive edge triggered JK Flip Flop
- Write a dataflow-style Verilog module Vradder8 for an adder with two 8-bit inputs A and B, carry input CIN, 8-bit sum output S, and carry output COUT. Please use handwriting
Counter I. Using structural verilog, write a top-level module for the One's Counter with as many instances of half adders and full adders as needed according to Prelab C.1 2. Write a test bench to verity the One's Counter design. Provide stimulus patterns in such a way that every input output of each half and full adder toggle (change value) at least once
Counter I. Using structural verilog, write a top-level module for the One's Counter with as many instances...
Write a test bench to thoroughly test the Verilog module dff_fe_asyn_h. below is the module ddff_fe_asyn_h.code Simulate the circuit using ISim and analyze the resulting waveform. Take full screenshots of all Verilog source codes and the resulting simulation waveform to be included in the lab report. Include explanation of the waveform and how you can conclude that the D flip flop implemented in step 9 is correct in the lab report. Verilog Code for dff_fe_asyn_h is mentioned below:- //DFF module...