[Vivado] 0X. Source Code
Calculator_8bit_PB_FSM_stopwatch.v `timescale 1ns / 1ps module Calculator_8bit_PB_FSM_stopwatch( input clk, input reset, input [7:0] i_a, input [7:0] i_b, input i_pbrunstop, input i_pbclear, output [3:0] o_digitSel, output [7:0] o_fndFont ); wire [8:0] w_sum; wire w_stoprun, w_clear; wire [13:0] w_stopwatchValue, w_FndsourceValue; wire w_pbrunstop, w_pbclear; PushButton_Oneshot U_pb_runstop(clk,..
[Vivado] 06. Calculator 8bit, FSM StopWatch 0.1s UpCount
[1] StopWatch 설계 후, FSM (sw[0], sw[1]) 으로 Stop, Run, Clear 상태 제어. stopwatch 내부에 clkDivider 와 0.1s Counter 가 필요하다. clkDivider 는 10hz, Counter 는 0 ~ 9999 까지 Count 하도록 설계한다(14bit). fig.1 과 같이 FSM 의 stoprun 신호를 받을 수 있는 enable 과 clear 신호를 받는 reset(clear) port 를 선언해주어야 한다. `timescale 1ns / 1ps module stopwatch( input clk, input reset, input i_run_stop, input i_clear, output [13:0] o_upCounter ); wire ..
[Vivado] 03. Adder 8bit
Half Adder. module half_adder ( input i_a, input i_b, output o_sum, output o_carry ); assign o_sum = i_a ^ i_b; assign o_carry = i_a & i_b; endmodule Full Adder 1 bit. module full_adder_1bit ( input i_a, input i_b, input i_cin, output o_sum, output o_carry ); wire w_sum1, w_carry1, w_carry2; half_adder U_HA_0 ( .i_a(i_a), .i_b(i_b), .o_sum(w_sum1), .o_carry(w_carry1) ); half_adder U_HA_1 ( .i_a(..
[Vivado] 02. FndController, Counter, DigitSplitter, clkDivider
[1] Counter 2x4 Decoder 의 출력 ([3:0] o_digitSel) 을 반복적으로 Count 하는 Counter 를 설계하려고 한다. 4 개의 7-Segment 를 동작하기 위해 Counter 의 bit 는 2-bit 이다. clk 가 들어올 때마다 + 1 씩 Count 가 쌓이게 되고, reset 입력 시, 0 으로 초기화 된다. Counter 의 출력 (o_count) 은 2x4 Decoder 의 입력 (i_x) 으로 들어간다. [2] DigitSplitter, mux 4x1 0 ~ 9999 사이의 값을 입력 ([13:0] i_number, 0 ~ 16384) 으로 받을 경우, 각 자릿 수의 [3:0] Digit Number (o_dig_1, o_dig_10, o_dig_100, o..