Quality control (1)/Verilog 8

Verilog - LFSR( Linear feedback shift register ) / Fibonacci & Galois LFSR

LFSR LFSR이란? : Linear Feedback Shift Register의 약자로, 선형 되먹임 시프트 레지스터이다. Shift Register에 입력되는 값이 이전 상태의 선형 함수로 다시 되먹임되는 Linear Feedback구조이다. 이전 상태가 Feedback되어 다음 상태를 만들기 때문에 "결정론적이다"라고 할 수도 있다. Fibonacci LFSR module fibonacci_LFSR( input clk, input arst_n, output LFSR ); parameter BITWIDTH = 5; //bitwidth만큼 reg생성 output reg [BITWIDTH -1 : 0 ] LFSR; always @(posedge clk or negedge arst_n) begin if(..

Verilog - Finite State Machine (FSM) / Lemming Game

FSM(Moore)을 이용한 Lemming Game(1) [Problem] Design source code //RTL code module Lemmings1( input clk, input rst_n, input bump_left, input bump_right, output walk_left, output walk_right ); //explicit expression localparam LEFT = 0, RIGHT = 1; reg present_state, next_state; //next_state compuation always @(*) begin //next state computation logic - Combinational Logic case (present_state) LEFT : ne..

Verilog - 4bit Ripple Carry Adder

Full Adder 4bit Full Adder Hierarchical Design module이 여러개일 때 ( design source) 4bit full adder를 만들기 위해서는 half_adder, full_adder, full_adder_4bit 총 3개의 module을 필요로 한다. Vivado에서는 여러 개의 모듈을 사용할 수 있다. 여러 개의 모듈이 포함된 위와 같은 vivado design을 작성할 때, 일반적으로 하나의 design source file에 모든 모듈을 작성한다. 이렇게 하면 모듈 간 종속성을 쉽게 관리할 수 있으며, 코드를 쉽게 재사용할 수 있다. 따라서, 여러 개의 module을 사용하더라도 하나의 design source file에 모든 module을 작성하는 것..

Verilog - Synthesis (full_adder_dataflow) / LUT / truth table

Synthesis full_adder_dataflow module full_adder_dataflow( x,y,c_in, sum,c_out ); input x,y,c_in; output sum,c_out; assign {c_out,sum}=x+y+c_in; endmodule 위 코드를 작성하고 schematic을 확인하면 위와 같이 RLD_ADD를 확인할 수 있으나, RTL_ADD가 실제로 어떤 gate들로 이루어지는지 알 수 없다. 이 때 Verilog code의 gate합성을 확인할 수 있는 도구가 바로 sythesis이다. Synthesis : High-level language 를 Low-level language로 변환하는 것을 일반적으로 Synthesis라고 한다. 디지털 시스템 설계에서의 S..

Verilog - 8case_4true / boolean expression / schematic

Verilog Basic - hw(1) 과제(1) - 3bit binary(A,B,C)로 표현된 7가지 경우에 대하여 m0,m2,m6,m7에 대해서만 true(y=1) Boolean Expression Y = A'C' + AB wire 구현 : wire는 초반에 선언을 모두 하지 않고, main body에서 gate들을 구현하며 필요로 하는 것을 추가하여 선언한다. Verilog Design source module _8case_4true(out, i0, i1, i2); //output,input declaration output out; input i0,i1,i2; //wire declaration wire n0,n2; wire a0,a1; //gate declaration //not gate not ..