// CPEN 230 lab 9 part 3, 4-bit synchronous counter on the DE2-115 board // Firstname Lastname, date // File: counter4bit_top.v module counter4bit_top ( input [2:0] KEY, // Clock, Enable, nReset output [3:0] LEDR, // discrete red LEDs for output output [6:0] HEX0 ); // 7-segment display for output wire [3:0] count_w; // to connect rippleCounter to hex7seg counter4bit inst0 ( .Clock (KEY[2]), // key press and release makes a pos. edge on Clock .nReset (KEY[0]), // key press resets .Enable (KEY[1]), // key press disables .Count (count_w) ); assign LEDR = count_w; // count out to 4 red LEDs hex7seg inst1 ( // count out to 7-segment display .num_i (count_w), .disp_o (HEX0) ); endmodule