moduleTop(inputwireclk,outputwireLED,outputwire[7:0]SEGMENT,outputwire[3:0]AN);wireQa;wireQb;wireQc;wireQd;wire[3:0]Hex;/* module clk_1s at submodules/clk_1s.v */clk_1sm0(.clk(clk),.clk_1s(clk_1s));/* You need to implement module Counter4b */Counter4bm1(.clk(clk_1s),.Qa(Qa),.Qb(Qb),.Qc(Qc),.Qd(Qd),.Rc(LED));assignHex={Qd,Qc,Qb,Qa};// Please replace module below with your module completed in Lab 6// Pay attention to the correctness of the module name and port name// NOTE: SEGMENT and Segement are different port names// BTN[0]: LE, valid with value 0// BTN[1]: point, light with value 1// SW[7:4]: AN, light with value 1(AN[i] = ~SW[i+4])// SW[3:0]: number to displayDispNumdisplay(.BTN(2'b00),.SW({4'b0001,Hex}),.SEGMENT(SEGMENT),.AN(AN));endmodule
/** module RevCounter * input * clk: A clock signal driven by module clk_1s. * s: 0 for increment, 1 for decrement * output * cnt: a 16-bits register * Rc: rise when the counter reset(i.e. carry will be set), that is, Rc becomes 1 when * increment(s=0 & cnt=F) or decrement(s=1, cnt=0) *///! NOTE: DO NOT CHANGE THE MODULE NAME & PORT NAMESmoduleRevCounter(inputwireclk,inputwirerst,inputwires,outputreg[15:0]cnt=0,outputwireRc);/* Your code here */endmodule
moduleTop(inputwireclk,inputwire[1:0]SW,outputwireLED,outputwire[7:0]SEGMENT,outputwire[3:0]AN);wire[15:0]cnt;wire[3:0]Hex;wireclk_1s;/* module clk_100ms at submodules/clk_1s.v */clk_1sclk_div_1s(.clk(clk),.clk_1s(clk_1s));/* You need to implement module RevCounter */RevCountercounter(.clk(clk_1s),.rst(SW[1]),.s(SW[0]),.cnt(cnt),.Rc(LED));// Please replace module below with your module completed in Lab **7**// imoprt submodules for module DisplayNumber from your prev. projectDisplayNumberdisplay(.clk(clk),.rst(1'b0),.hexs(cnt),.LEs(4'b0000),.points(4'b0000),.AN(AN),.SEGMENT(SEGMENT));endmodule