Study/Digital System Design and Lab[Verilog]

#1 Digital Circuit Design

얼죽아여뜨샤 2023. 10. 3. 13:44

*Digital System Advantage

Reproducibility, Reliability, Accuracy, Noise immunity, Flexibility, Easy of integration, etc...

=> 집적 용이, 저장이 쉬움->유지보수 쉬움

 

*Hardware Description Languages(HDLs)

  • HDLs can describe a digital system at several different levels.
    - behavioral and structural
  • HDLs lead naturally to a top-down design methology
  • Two popular HDLs
    - VHDL and verilog
  • Verilog is a HDL used to describe the behavior and/or structure of digital systems.

 

*Digital Circuit Design

  • Combinational circuits
    : output only depends on the present input
    : does not require clock
    : no memory element
    : Eg: adder, coder, mux, etc.

  • Sequential circuits <순차회로> 
    : output depends on present input & past output
    : require clock (for state transition)
    : has memory element -> 이전 값을 기억하는 memory 필요
    : Eg: flipflop, conunters, registers, etc.

*Verilog Description of Combinational Circuits

  • Verilof models combinational circuits by what are called concurrent statements of continuous assignments.
  • Concurrent statements (continuous assignments) are
    : Statements that are always ready to execute.
    : Evaluated any time and every time a signal on the right side of the statement changes.
    : Execute repeatedly as if they were in a loop.
Concurrent statement
: 실제 회로에서는 입력 포트에서 출력 포트로의 신호 전달이 동시에 처리되므로, VHDL은 기본적으로 Concurrent Processing에 기반하고 있다.
즉, VHDL의 𝙰𝚁𝙲𝙷𝙸𝚃𝙴𝙲𝚃𝚄𝚁𝙴 Statement내에서 𝙿𝚁𝙾𝙲𝙴𝚂𝚂 Statement의 내부를 제외한 모든 Statement들은 Concurrent하게 처리된다. (즉, VHDL은 Concurrent가 Default이다.)

 

assign #5 C = A & B;

assign #5 E = C | D;

 

A+B = C -> c = A&B
CD = E -> E = D|C
=> 컴퓨터의 도움을 받아 Hardware 언어로 바꾸는 것

 

: #5는 5ns의 delay 시간이다.

: "=" 는 signal assignment operator이다, 오른쪽 값을 왼쪽에 할당한다는 의미이다.
: assign statement는 assign 값에 사용된다.

 

module two_gates (A, B, D, E);
output E;

intput A, B, D;
wire C;
	assign C = A && B; //concurrent
    assign E = C || D; //statements
endmodule
  • data type
    1. wire - 일시적인 값을 가질때
    2. register
  • Module 은 내부 모듈을 작동시키거나 input output신호들을 선언시 사용하는 basic building block이다.

 

*Testing a Verilog Model

  • 모델을 완벽히 사용하기 전에 테스트 해야한다.
  • A test bench는 짠 Verilog code를 시험하는 모델이다.
    시뮬레이션이라고 한다.