1 / 53

Digital System Design

Digital System Design. 2006. 3. 이숙윤 (uni7@vada1.skku.ac.kr). 60 ~ 70 년대. 80 년대. 90 년대 - 현재. 설계 방법. Transistor Level Bottom Up. Gate Level (Top Down + Bottom Up). Algorithm, Function Level Top Down. 설계 도구. Layout Editor. Schematic Editor. HDL Synthesizer. 설계 범위. 1K Gate 이하

wren
Télécharger la présentation

Digital System Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital System Design 2006. 3. 이숙윤(uni7@vada1.skku.ac.kr)

  2. 60 ~ 70 년대 80 년대 90 년대-현재 설계 방법 Transistor Level Bottom Up Gate Level (Top Down + Bottom Up) Algorithm, Function Level Top Down 설계 도구 Layout Editor Schematic Editor HDL Synthesizer 설계 범위 1K Gate 이하 Gate, Counter, MUX 10K ~ 100K uprocessor 100K 이상 고성능 프로세서 VHDL(Very High Speed IC Hardware Description Language) • 설계환경의 변화

  3. D Q CK CD VHDL(Very High Speed IC Hardware Description Language) • VHDL 설계 Flow HDL 설계 IF (CD = ‘1’) THEN Q <= ‘0’; ELSE IF (CLK ’event and CLK = ‘1’) THEN Q <= D; END IF ; Synthesis Structural Description Placement & Routing

  4. VHDL(Very High Speed IC Hardware Description Language) • VHDL의 등장배경 • Gate Count 및 디자인의의 복잡성 증가 • 설계자 간의 정보 공유를 위한 표준화된 언어의 필요성 대두 • Top-down 설계의 필요성 대두 • 설계의 유지보존을 위한 문서화 필요 • 표준화된 HDL의 요구

  5. VHDL(Very High Speed IC Hardware Description Language) • VHDL의 표현방법 • 동작적 모델링(Behavioral Modeling) • Functional or Algorithm Description • High Level Language Program 과 유사 • 문서화를 위해서 우수 • 입력상태에 대한 출력결과만을 고려한 기술방법. • 시스템이 내부적으로 어떠한 하드웨어적인 구조를 가지는지에 상관없고, 오로 지 진리표 등으로 표현된 것을 기능적 또는 수학적인 알고리즘을 사용하여 시스 템을 동작하는 기술. • 데이터플로우 모델링(Dataflow Modeling) • Behavioral Description보다 한 단계 낮은 Level • Boolean Function, RTL, 또는 연산자 (AND, OR) 표현 • 구조적 모델링(Structural Modeling) • 가장 하드웨어적 표현에 가까움 • 구성요소 및 연결까지 표현

  6. VHDL 개요 • VHDL의 구성 • Package • Entity • 설계의 입출력 • 반드시 entity이름이 file이름이 된다. • Architecture • 설계의 실제 내용 • 한 설계에는 다수의 package와 entity, architecture가 존재 • Configuration • 다수의 architecture를 갖는 entity가 있을 경우 그 연결관계 를 설정. • 실제로 configuration의 사용은 VHDL의 합성 후 post-simulation 혹은 gate-simulation과정에서 많이 이용된다.

  7. x t1 sel mout selb y t2 mux x mout y sel VHDL 개요 • Entity선언 entity mux is Begin port ( x, y, sel : in std_logic; mout : out std_logic); end mux; • Architecture body 선언 : 회로의 동작상태와 내부의 선 연결상태를 기술 architecture name of entity_name is signal selb, t1, t2: std_logic; Begin selb <= not sel; t1 <= x and sel; t2 <= y and selb; mout <= t1 or t2; end ex1;

  8. VHDL 개요 • Signal mode : signal의 입출력상태를 표시 • in : 입력 • out : 출력 • inout: 입출력 가능 • buffer: 한 회로의 출력이면서 다른 회로의 입력으로 작용할 때 • Signal Type • 1bit signal : std_logic • 2bit이상의 signal: std_logic_vector • std_logic_vector(1 downto 0) • std_logic_vector(0 to 3) input out buffer inout

  9. VHDL 개요 • 객체(Object) • 값을 가질 수 있는 어떤 변수(객체)를 선언하는 방법 • signal, variable, constant 3가지 • Signal : 선으로 구현될 수 있는 외적변수 • signal set, clear, D: std_logic; • set <= ‘1’; clear < = ‘0’; D <= set; • 병렬구문에서 사용(concurrent Statement) • variable: 중간 매개 변수, 선으로 구현되지 않는 내적변수 • variable val: integer; • val := ‘1’; • 순차구문(Sequential Statement) • constant: 변경가능성이 많은 상수를 저장할 때 사용되는 변수 • constant delay : time := 10ns

  10. VHDL 개요 • 연산자(Operator) • Logical 연산자 • and, or, nand, not, xor, nxor • Shift 연산자 • sll(shift left logic), srl(shift right logic) • sla(shift left arithmetic), sra(shift right arithmetic) • rol(rotate left logic), ror(rotate left logic) • 관계 연산자 • =, /=, <, <=, >, >=

  11. VHDL 개요 • 병렬구문(Concurrent Statement) & 순차구문(Sequential Statement)

  12. VHDL 개요 • 병렬구문(Concurrent Statement) • 어떤 회로에 대한 동시적인 회로상태의 변화. • 표현문장의 순서에 상관없이 똑같이 우선순위. • Simulation을 하면 첫 번째 줄의 쓰여진 동작 표현이나 마지막 줄에 쓰여진 동작표현이나 같은 시간에 simulation 될 수 있다. • 순차구문(Sequential Statement) • 일반적인 로직의 순차적 상태를 기술할 수 있는 문장. • 반듯이 앞의 문장이 진행되어야 뒤에 문장이 진행된다. • Concurrent 문의 Subprogram과 process문장에서 사용된다.

  13. VHDL 개요 • 병렬구문(Concurrent Statement) & 순차구문(Sequential Statement) Architecture ex of entiry is signal my_signal : std_logic_vector(3 DOWNTO 0); begin PROCESS(...) BEGIN My_signal <= "0000"; My_signal(3) <= '1'; My_signal(1) <= '1'; END PROCESS; End ex; Architecture ex of entity is signal my_signal : std_logic_vector(3 DOWNTO 0); Begin My_signal <= "0000"; My_signal(3) <= '1'; My_signal(1) <= '1'; End ex;

  14. VHDL 개요 • Behavioral Representation • 설계하려는 하드웨어의 구조와 관계없이 시스템의 동작을 알고리즘 레 벨에서 표헌. • Process나 subprogram내에서 사용된다. • 차례대로 수행되는 문장. • Wait, signal할당문, assert문, exit문, if문, loop문, next문 등… architecture ex5 of mux is begin process (sel, x, y) begin if sel = '1' then mout <= x; else mout <= y; end if; end process; end ex5; entity mux is port (x, y, sel: in BIT; mout: out BIT); end mux; mux x mout y sel

  15. z0 s0 1-out-of-4 decoder z1 z2 s1 z3 enable VHDL 개요 • Behavioral Representation : Decoder begin process (s, enable) if (enable=‘1’) then if (s=“00”) then z <= “0001”; elsif (s=“01”') then z <= “0010”; elsif (s=“10”') then z <= “0100”; else z<=“1000”; end if; else z<=“0000”; end if; end process;

  16. VHDL 개요 • Behavioral Representation : D FF entity D_FF is port(DIN, clk, rstnn: in BIT; DOUT: out BIT); end D_FF; architecture behavior of D_FF is begin process (rstnn, clk) begin if (rstnn=‘0’) then DOUT <= ‘0’; elsif clk=‘1’ and clk’event then DOUT <= DIN; end if; end process; end behavior; D-FF DIN DOUT clk rstnn

  17. VHDL 개요 • Behavioral Representation : Process문 • 하드웨어 시스템 모듈은 서로간에 병행적으로 수행되므로 시스템의 동작으로 표현하기 위해서는 Concurrent문을 사용. • 모듈의 내부는 순차적으로 이루어지므로 Sequential 문을 사용. • Process문 자체는 Concurrent문이므로 여러 개의 Process문이 있으면 이들은 서로 병행적으로 수행. • 하나의 Process문 내부는 하나씩 수행되는 Sequential문으로 표현. Process [(Sensitivity_list)] {선언문} Begin {Sequential문} End process [process_Lable]

  18. VHDL 개요 • Behavioral Representation : Process문 – Sensitivity List • 보통 모든 input signal들을 sensitivity list에 포함 • Sensitivity list내의 signal중에서 적어도 하나의 값이 변화해야 process문 이 시작한다. • D-FF 형태의 process인 경우 reset 과 clock만 input signal에 포함 • Output signal이 sensitivity list에 포함되는 경우에는 infinite loop 이 발생 할 수가 있다. begin process (a) a<= not a; end process;

  19. VHDL 개요 • Behavioral Representation : IF Statement • Example: entity OR2 is port (a,b : in std_logic; y : out std_logic); end OR2; architecture EX1 of OR2 is begin process (a,b) begin if a=‘1’ or b=‘1’ then y<=‘1’; else y<=‘0’; end if; end process; end EX1; • If_statement if boolean_expression then sequential_statements [ elsif boolean_expression then sequential_statements ] [ else sequential_statements ] end if;

  20. VHDL 개요 • Behavioral Representation : IF Statement architecture EX2 of OR2 is begin process (a,b) begin if a=‘1’then y<=‘1’; elsif b=‘1’ then y<=‘1’; else y<=‘0’; end if; end process; end EX2; architecture EX3 of OR2 is begin process (a,b) begin y <=‘0’; if a=‘1’ or b=‘1’ then y<=‘1’; end if; end process; end EX3;

  21. VHDL 개요 • Behavioral Representation : CASE Statement case expression is when choices => sequential_statements [ when choices => sequential_statements ] [ when others => sequential_statements ] end case; type OP_CODE is (ADD, SUB, MULT, DIV); variable instruction : OP_CODE; case instruction is when ADD => y <=a+b; when SUM => y<=a-b; when MULT => y<=a*b; when DIV => y<=a/b; when others => y<=(others => ‘0’); end case;

  22. VHDL 개요 • Dataflow Representation • Behavioral 과 Structure 표현의 중간단계로서 데이터흐름을 나타내듯이 시스템의 기능을 나타낸다. • 주로 연산자, 함수 등으로 표현한다. • VHDL구문 중에서 주로 concurrent signal 할당문으로 기술한다. architecture sample of Or2 is begin process (x, y) begin O1 <= I1 or I2 after 5 ns; end process; end ex5; architecture sample of Or2 is begin O1 <= I1 or I2 after 5 ns; end ex5;

  23. VHDL 개요 • Dataflow Representation – Conditional Concurrent Signal • 여러 불 조건을 검사하여 참이면 해당하는 파형을 할당하는 문장. • 조건을 예측할 수 없는 경우에 사용한다.(if) architecture sample of Or2 is begin Signal 이름 <= 파형1 when조건1 else 파형2 when조건2 else . 파형 n; End sample; • Dataflow Representation – Selected Concurrent Signal • 수식의 최종값과 선택의 값이 일치하는 경우 해당하는 파형을 지정. (case) architecture sample of Or2 is begin With 수식 select Signal 이름 <= 파형1 when선택1, 파형2 when선택2, . 파형 n when 선택n; End sample;

  24. VHDL 개요 • Dataflow Representation – conditional assignment and selected assignment * 4*1 MUX 의 modeling library ieee; use ieee.std_logic_1164.all; entity mux4_1 is port (in0, in1, in2, in3 : in std_logic ; sel : in std_logic_vector(1 downto 0); y : out std_logic); end mux4_1; entity문은conditional , selected동일

  25. VHDL 개요 • Structural modeling • Definition • Pure structural modeling describes entity in terms of its sub-components and how these are connected. • It is, in effect, a hierarchical arrangement of interconnected components structural modeling steps component declaration component identifier_name [ generic (local_generic_list) ;] [ port (local_port_list)] ;end component ; component instantiation label: component_declaration_name [ generic map (association_list) ;] [ port map (association_list) ;]

  26. VHDL 개요 • Structural modeling - Example entity half_add is port (x, y: in std_logic; co, so: out std_logic); end half_add; architecture behav of half_add is component and_2 port (a, b: in std_logic; c: out std_logic); end component; component xor_2 port (a, b: in std_logic; c: out std_logic); end component; Begin u1: xor_2 port map ( a=>x, b=>y, c=>so); -- named association u2: and_2 port map ( x, y, co); -- positional association end behav ;

  27. 디지털 시스템 • 전가산기(Full Adder) 설계 : Behavioral Modeling • 반가산기(Half Adder) • 1비트의 2개 2진수를 더하는 논리회로. • 2개의 입력과 출력으로 구성. • 2개 입력은 피연산수 x와 연산수 y 이고, 출력은 두 수를 합한 결과인 합 S(sum)과 올림수 C(carry)를 발생하는 회로.

  28. 디지털 시스템 • 전가산기(Full Adder) 설계 : Behavioral Modeling • 전가산기(Full Adder) • 하위비트에서 발생한 올림수를 포함하여 3개의 입력 비트들의 합을 구하는 조 합논리회로. • 3개의 입력과 2개의 출력으로 구성됨. • 3개 입력은 피연산수 x와 연산수 y, 그리고 하위 비트에서 발생한 올림수 Ci 가 • 되고, 출력변수는 출력의 합 S(sum)과 올림수C(carry)를 발생하는 회로.

  29. 디지털 시스템 • 전가산기(Full Adder) 설계 : Structural Modeling

  30. 디지털 시스템 • 조합회로 : 4 Bit 리플 캐리 가산기(4 Bit Ripple Carry Adder) • 4비트 이진수를 입력 받아 4비트 덧셈결과를 출력. • Ex) Xilinx ISE와 Modelsim를 이용하여 합성하고, 검증하시오. (Structure Modeling)

  31. 디지털 시스템 • 조합회로 : 8 Bit 가산기(8 Bit Full Adder) • M비트 이진수를 입력 받아 M비트 덧셈결과를 출력. • Overflow 고려 설계 ( 111(7) + 110(6) = 1101(13)) • Ex) Xilinx ISE와 Modelsim를 이용하여 합성하고, 검증하시오. (Structure Modeling)

  32. 디지털 시스템 • 조합회로 : 1Bit 비교기(1 Bit Comparator) • 두 입력이 서로 같은지 또는 다른지를 비교하여 알려주는 회로. • 1비트 비교기는 두 입력이 같으면 ‘1’을 출력하고, 다르면 ‘0’을 출력하는 회로. • Ex) ISE와 Modelsim을 이용하여 설계하고 검증하시오.(Behavioral Modeling)

  33. 디지털 시스템 • 조합회로 : 4Bit 비교기(4 Bit Comparator) • 두 입력이 같으면 EQ=‘1’, AGB=‘0’, ALB=‘0’을 출력. • A값이 B값보다 크면 AGB=‘1’, EQ=ALB=‘0’을 출력. • A값이 B값보다 작으면 ALB=‘1’, EQ=AGB=‘1’을 출력. • Ex) ISE와 Modelsim을 이용하여 설계하고 검증하시오.(Behavioral Modeling)

  34. 디지털 시스템 • 조합회로 : 3X8 Decoder • 부호화된 정보를 복호화하는 데 사용 • N bit 2진 code => 2n개 서로 다른 정보 • 입력이 3개인 신호에 따라서 0,1,2,3,4,5,6,7이라는 8개의 출력이 있으며, 1개만 활성화가 된다.

  35. 디지털 시스템 • 조합회로 : 3X8 Decoder • ISE와 Modelsim을 이용하여 설계하고 검증하시오. • 1. 아래의 회로도를 보고 Dataflow형태로 설계하시오. • 2. Behavioral Modeling을 이용하여 설계하시오. (case문을 사용하고, Enable로 제어하는 부분 추가)

  36. 디지털 시스템 • 조합회로 : Encoder • Decoder의 역(inverse) 산술을 수행. • 2n개 이하의 입력선과 n개의 출력선. • 입력신호를 특정한 코드로 변환하는 회로.

  37. 디지털 시스템 • 조합회로 : Encoder • ISE와 Modelsim을 이용하여 설계하고 검증하시오. • 1. 아래의 회로도를 보고 Dataflow형태로 설계하시오. • 2. Behavioral Modeling을 이용하여 설계하시오. (case문을 사용하고, Enable로 제어하는 부분 추가)

  38. 디지털 시스템 • 순차회로 : 현재 출력은 현재의 입력과 기억소자에 기억된 과거 출력들과 의 조합에 의해 결정. 이전출력의 현재 입력이라는 시간적인 개념이 도입. • 순차 논리는 조합논리와 클럭에 의해 구동되는 메모리 소자(주로 flip/flop) 로 구성 • 플립플롭은 정보의 저장 또는 기억회로, 계수회로, 및 데이터 정보 전송 회 로에 많이 사용되며, 동작특성에 따라 RS, D, JK, T플립플롭으로 나누어 진 다.

  39. 디지털 시스템 • 플립플롭의 동작은 신호의 level에서 동작하느냐 Edge에서 동작하느냐에 따라 비동기형 플립플롭(Latch)와 동기형 플립플롭으로 나눈다. 우리가 이 야기하는 플립플롭은 동기형 플립플롭을 말한다. • Clock 구문의 VHDL정의 • Clock 동기회로 설계를 위한 구문. • Process문 내부에서 if-then –else 구문과 함께 사용. • Rising, Falling Edge를 선택. • 동일 Process내에서는 단일 Clock, 단일 Edge만 사용. • (signal’event and signal=‘1’)  rising edge. • (signal’event and signal=‘0’)  rising edge.

  40. 디지털 시스템 • 순차회로 : D FF • 클럭의 상승 모서리 또는 하강 모서리에서 동작한다. • D라는 한 개의 데이터 입력을 가지며, D입력에 가해진 데이터는 클럭신호에 의하여 출력으로 그대로 전달된다. • D FF는 데이터를 잠깐 간직하는 Register 등과 빠른 속도의 용량이 작은 메모 리등에 많이 이용된다.

  41. 디지털 시스템 • 순차회로 : 8Bit Register • 래치와 플립플롭은 1비트의 정보를 저장.. • 래지스터는 2비트 이상의 정보를 제어신호에 의하여 기억하는 소자. • 이러한 레지스터로서 널리 사용되는 것이 D 플립플롭이다.  D 플립플롭은 데이터를 저장했다가, 데이터의 변화없이 출력하기 때문.

  42. 디지털 시스템 • 계수기(Counter) • 일정한 출력순서를 반복적으로 발생시키는 회로. • 과거의 값을 저장하는 레지스터와 과거의 값을 증가하는 덧셈기로 구성. • 일반적은 계수기는 1씩 증가하는 계수기를 말한다. • 계수기의 입력펄스와 출력값을 적절히 이용하면 사용자가 원하는 주파수를 갖는 디지털 주파수 발생기를 설계할 수 있다.

  43. 디지털 시스템 • 레지스터를 이용한 비동기 리셋 카운터 설계 • 클럭의 상승 에지에서 Reg8 회로의 논리값이 발생하고, 발생된 논리값은 피 드백이 된다. • 피드백 논리 값은 +1이 증가되어 Reg8의 입력 값으로 입력되어 클럭의 상승 에지를 기다리는 대기상태가 된다.

  44. 디지털 시스템 • Up-Down Counter Logic 설계 • 제어신호에 의하여 클럭 입력에 맞추어 카운터가 증가하거나 또는 감소하는 카운터를 업다운 카운터라고 한다. • 아래의 블록도에서 보면, MUX에 의해 Register8에서 출력되는 논리값의 피드 백 값이 +1이 증가된 값과 -1이 감소된 값 중에서 하나를 선택하도록 되어있 다.

  45. 디지털 시스템 • Counter with Enable Logic 설계 • 클럭신호의 상승 에지에서 EN 신호의 논리값이 ‘1’일때는 카운터로 동작하며, ‘0’일때는 현재의 값을 그대로 유지하는 동작을 수행.

  46. 디지털 시스템 • 비동기 계수기(Asynchronous Counter) • 아래의 그림에서와 같이 비동기 계수기는 각 계수기 Cnt#에 입력되는 클럭신 호가 다르다.이런 비동기 계수기는 대체적으로 회로가 간단하지만, 속도는 늦 다. • 최초 CLK0은 1MHz를 입력시켜 10분주된 100KHz(CLK1)을 발생시키고, CLK1을 입력받아 다시 10분주된 10KHz(CLK2) 를 발생시킨다.

  47. 디지털 시스템 • 동기 계수기(synchronous Counter) • 아래의 그림에서와 같이 동기 계수기는 각 계수기 Cnt#에 입력되는 클럭신 호가 모두 동일하다. 이런 비동기 계수기는 대체적으로 회로가 복잡하지만, 속도는 빠르다. • 각각 입력되는 클럭을 이용하여 10분주 100분주, 1000분주되는 신호를 생성 할 수 있다.

  48. 디지털 시스템 • ROM(Read Only Memory) 설계 • 상수형태로 저장된 데이터를 주소값을 변화시켜 단지 읽을 수만 있는 메모리 • ROM Size = 주소개수 * 데이터 비트수 • CE : ROM의 칩 선택 여부를 나타내고 active-low동작 • OE : 읽은 데이터를 외부로 출력하는 여부를 지정하고 active-low동작. • ROM VHDL표현 : 2차원 array type 선언. • 8 * 5 의 2차원 array VHDL표현 • Subtype ROM_Word is std_logic_vector(4 downto 0); : 한 개의 주소에 저장되는 데이터의 크기 • Type ROM_Table is array(0 to 7) of ROM_Word; : 8개의 ROM_word로 구성되는 array 구조 • ROM에 기억되는 데이터는 상수형태 : 미리선언. • Constant ROM_DATA : ROM_Table := ROM_Table’( “10101”, “10111”,“00101”,“10111”, “00001”,“10001”,“01001”,“10111”); • ROM의 주소는 Std_logic_vector의 데이터 타입을 사용하지만 2차원 array선언은 integer로 선언되어야 하므로 형변환이 필요. : conv_integer(Address)함수 사용.

  49. 디지털 시스템 • RAM(Random Access Memory) 설계 • 주소지정으로 기억되어 있는 데이터를 읽어내는 기능과 외부에서 입력되는 데 • 이터를 저장하는 메모리. • RAM Size = 주소개수 * 데이터 비트수 • CE : RAM의 칩 선택 여부를 나타내고 active-low동작 • RD : 읽기 동작을 요구하고 active-low동작. • WR : 쓰기 동작을 요구하고 active-low동작. • Read operation : CE=‘0’, RD=‘0’, WR=‘1’ • Write operation : CE=‘0’, RD=‘1’, WR=‘0’ • Synchronous RAM?

  50. 디지털 시스템 • FSM(Finite State Machine) 설계 • 디지털 회로의 상태 변화를 나타내는 방법. • Example) Coffee Vending Machine • 전원이 인가되면 “00”상태로 존재. • “00” 상태에서 동전이 들어오면(Coin_in=‘1’) “01” 상태로 천이, 그렇지 않으면 (coin_In=‘0’) “00” 상태에 계속 존재. • “01” 상태에서 coffee가 선택이 되면(coffee_sel=‘1’) “10” 상태로 천이, 그렇지 않 으면(coffee_sel=‘0’) “01” 상태로 계속 존재. • “10” 상태에서 coffee를 제공했으면(coffee_serve=‘1’) “00”상태로 천이, 그렇지 않으며(coffee_serve=‘0’) “10”상태로 계속 존재. • Reset이 인가될 때 상태천이?

More Related