Verilog Vivado Count_8 Bit.v Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
`timescale 1ns / 1ps
// 8 bit counter
// input : rst, clk
// output, cntout [7:0]
module count_8bit(
    input rst,
    input clk,
    output [7:0] cntout
    );
    reg [7:0] out;
    
    always @ (posedge clk or posedge rst ) begin
        if(rst == 1'b1) begin
            out <= 8'b0000_0000;
        end
        
        else begin
            out <= out + 1'b1;
        end
    end
    assign cntout = out;
endmodule

This is the Verilog code that written with Vivado for implementing Stopwatch in FPGA Board(Xilinx; Nexys S).

'Study' 카테고리의 다른 글

Verilog Vivado tb_Stopwatch.v Code  (0) 2019.05.26
Verilog Vivado Stopwatch.xdc Code  (0) 2019.05.26
Verilog Vivado Lab14Stopwatch.v Code  (0) 2019.05.26
Verilog tb_HalfAdder.v Code  (0) 2019.05.26
Verilog tb_FullAdder.v Code  (0) 2019.05.26

+ Recent posts