jinformations
Newbie level 4
Code:
module Fulladd(
input a
input b,
input cin,
output s,
output cout
);
xor(s, a, b, cin);
and(t1, a, b);
and(t2, a, cin);
and(t3, b, cin);
or(cout, t1, t2, t3);
endmodule
module add3(a2, a1, a0, b2, b1, b0, s2, s1, s0, cout);
input a2, a1, a0, b2, b1, b0;
output cout, s2, s1, s0;
Fulladd stage0 (a0, b0, 0, s0, c1);
Fulladd stage1 (a1, b1, c1, s1, c2);
Fulladd stage2 (a2, b2, c2, s2, cout);
endmodule //
This is what I built for the full adder; when I connect to a board in class I connect the 3 bit inputs to switches on the board. I have Cin = 0; This displays a 4 bit output with the outputs going to LEDs. I need help coding this to get the output to display onto a 1s seven segment display. If the output is over 10 the 10s display will turn on.
My teacher gave me a hint but would not help much further. He told me the module with have "assign a" and assignment verilog. I am using this in Vivado and a Basys3 board to display this in class.
Thanks in advance for help!