Quartus - Signal Tap
·
IDEC 교육
FPGA 내부 신호를 읽어서 디버깅에 도움을 주는 Signal Tap 사용 방법Basic ANDall Signals triggered = CaptureBasic ORone of the Signals triggered = CaptureComparisionCompares value with conditionsAdvancedCreates complex trigger
Day 4 - 7-seg BCD Counter
·
IDEC 교육/Verilog HDL
// BCD Counter with modulo Kmodule alu_ex3 #( parameter N = 32, parameter K = 10, parameter M = 3)( input wire clk, input wire rstn, output wire [6:0] bcd0, output wire [6:0] bcd1, output wire [6:0] bcd2);wire roll0, roll1, roll2;wire [ 3:0] led[0:2];modulo_cnt #(.K(50000000)) u_cnt_base (.clk(clk), .rstn(rstn), .ena(1'b1 ), .led( ), .roll(roll0)..
Day 4 - 7-Segment Decoder
·
IDEC 교육/Verilog HDL
Code// 7-Segment Displaymodule alu_ex1 ( input wire clk, input wire rstn, input wire [1:0] digit, output reg [6:0] seg);always @(posedge clk, negedge rstn) begin if (~rstn) seg clk와 rstn은 없어도 되는데 그냥 생각없이 만들다가 넣어서 귀찮아서 놔둠7 Seg 같은 경우 DE2-115를 사용중이기 때문에 Ref 파일을 보면 0이 켜는거고 1이 끄는것이며각각 PIN을 연결해주면 완성이다.
Day 4 - FPGA Example (with DE2-115)
·
IDEC 교육/Verilog HDL
프로젝트 제작 Example - CLK 기반 LED 주기적으로 ON / OFFmodule example1#( parameter N = 25)( input wire clk, input wire rstn, output wire out);reg [N-1:0] count;always @(posedge clk, negedge rstn) begin if (~rstn) count LED의 작동이 매우 빠르기 때문에 Count의 MSB가 1일때 켜고 0일때 꺼지도록 설계Quartus SettingsAnalasys 를 진행 후에 Pin PlanningPin Planning은 Reference File을 보고 각 PIN의 이름과 전압을 설정Synthesis까지 진행 후에 Programmer에 들..
Day 2 - Case / Casez / Casex
·
IDEC 교육/Verilog HDL
Case (조건)Case문은 순차적으로 if문을 거친다고 생각하면된다.예시 (인코딩)참고로 다수 case를 하나로 연결할 때는 ,로 연결 하면 된다.reg [15:0] rega;reg [ 9:0] result;case (rega) 16'd0: result = 10'b0111111111; 16'd1: result = 10'b1011111111; 16'd2: result = 10'b1101111111; 16'd3: result = 10'b1110111111; 16'd4: result = 10'b1111011111; 16'd5: result = 10'b1111101111; 16'd6: result = 10'b1111110111; 16'd7: result = 10'b1..
Day 2 - Latch
·
IDEC 교육/Verilog HDL
Latch (Reset 없음)edge와 상관없이 값이 변경될때 작동예시DLatchalways @(*) begin if (G) Q
Day 2 - Synchronous / Asynchronous
·
IDEC 교육/Verilog HDL
Synchronous (동기)모든 작동이 clk 즉 clock기반으로 작동예시Sync. Resetmodule dff_sync( input wire clk; input wire reset; input wire D; output reg Q;)always @(posedge clk) begin if (reset) Q Asynchronous (비동기)모든 작동이 해당 신호 기반으로 작동, clk와 상관이 없이 작동예시Async. Resetmodule dff_async( input wire clk; input wire reset; input wire D; output reg Q;)always @(posedge clk, posedge reset) begin if ..
Day 2 - Continuous / Procedural Assignment
·
IDEC 교육/Verilog HDL
Continuous Assignment (연속 할당)assign문을 사용하여 Net Type에 값을 할당combinational logic를 구현할 때 사용모든 연산이 병렬로 수행예시wire A;assign A = (B|C)&D;Procedural Assignment (절차적 할당)always 또는 initial 내부에서 사용always 같은 경우 always @ (*)에서 *에 해당하는 신호가 트리거될때 "순차적"으로 실행주로 reg Type 변수를 대상으로 함Blocking Assignment (=)한 문장 실행 후 다음 문장 실행Nonblocking Assignment (모든 할당 동시에 실행예시always @(posedge clk) begin out =, 같은 경우 섞어서 한 블록에서 사용..