목록[Harman] 하만 반도체 설계 (100)
Kraklog

module state_machine ( input clk, res, input chn1, sync, valid, output reg data_a, data_b, validate, error ); `ifdef USER_EC parameter idle=5'b00000, header_wait=5'b00010, got_header=5'b00001, a1=5'b00100, a2=5'b00101, a3=5'b00110, b1=5'b01000, b2=5'b01001, b3=5'b01010, recover=5'b10000; reg [3:0] current_state, next_state; `else parameter idle=5'b00000, header_wait=5'b00010, got_header=5'b00001..

01.Program & Tool 더보기 02.Schematic 더보기 03.Schematic 더보기

클럭 도메인이 안맞을때도 사용가능하지만 이 기능을 사용하지 않고는 뒤에 로직이 하나 더 붙는다. (동작을 하지 않는 것은 아님) read enable 신호때 생성을 하게 만들거나 aclr에 asynchornous 를 해주는 세팅을 할 수 있게 하거나 이것에 대한 순서를 정할 수 있다. module sp_ram_sync_rdwo( input clk , input we , input [7:0] d , input [6:0] addr , output reg [7:0] q ); reg [7:0] mem [0:127]; always @ (posedge clk) begin if(we) mem[addr]

module my_shift_tx ( input clk , input aclr_n , input enable , input [7:0] shiftin , // parallel to serial output reg q ); reg [7:0] txData; wire [7:0] Shiftin_Serial = (enable) ? shiftin : {1'b0, txData[7:1]}; // Parallel to serial shift register always @(posedge clk or negedge aclr_n) begin if (!aclr_n) txData

module my_ram( input [7:0] data , input [4:0] address , input wren , input clk , output reg [7:0] q ); reg [7:0] mem [0:31]; always @ (posedge clk) begin if (wren) mem[address]

프로그램 : Quaturs Prime lite edition 18.1 사용문법 : Verilog 2001 보드 : DE1-SOC Verilog 를 이용해서 디지털 회로를 디지털할 때 always @ 구문을 이용한다면 항상 원하지 않는 Latch에 대해서 주의를 해야한다. (*항상 always @ 구문에 의해서만 생기는 것은 아니다. 주로 always @ 구문을 이용하면 자주 발생하는 것.) Verilog에서는 combination logic을 기술할 때 모든 조건에 대하여 입력하지 않으면 자동으로 logic을 형성하게 되는데 이전 값을 유지시키기 위해서 latch가 생긴다. module my_latch ( input [2:0] sel, input a, input b, input c, output reg ..