VHDL의 기본 Lecture #6.

Slides:



Advertisements
Similar presentations
//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
Advertisements

LECTURE 4: The VHDL N-bit Adder
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Adder Discussion D6.2 Example 17. s i = c i ^ (a i ^ b i ) c i+1 = a i * b i + c i * (a i ^ b i ) Full Adder (Appendix I)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
2-to-1 Multiplexer: if Statement Discussion D2.1 Example 4.
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
ECE 331 – Digital System Design
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
L23 – Arithmetic Logic Units. Arithmetic Logic Units (ALU)  Modern ALU design  ALU is heart of datapath  Ref: text Unit 15 9/2/2012 – ECE 3561 Lect.
AND Gate: A Logic circuit whose output is logic ‘1’ if and only if all of its inputs are logic ‘1’.
Modeling styles: 1. Structural Modeling: As a set of interconnected components (to represent structure), 2. Dataflow Modeling: As a set of concurrent assignment.
Data Flow Modeling of Combinational Logic Simple Testbenches
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 4: Modeling Dataflow.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
1 H ardware D escription L anguages Modeling Complex Systems.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
1 Combinational Logic Lecture #6. 모바일컴퓨터특강 2 강의순서 Decoder 3x8 Mux 4x1 Mux 8x1 Mux 8x1 4bits Half Adder Full Adder Ripple carry Adder 4-bit Adder.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
L26 – Datapath ALU implementation
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
Combinational Logic Lecture #6.
02 VHDL의 기본.
1 component OR_3 port (A,B,C: in bit; Z: out bit); end component ; Reserved Words  Declarations of Components and Entities are similar  Components are.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
George Mason University Data Flow Modeling in VHDL ECE 545 Lecture 7.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
Digital System Projects
CS/EE 3700 : Fundamentals of Digital System Design
ACANEL VHDL 의 이해와 실습 2000 년 1 학기 Computer Architecture (classes links)
Data Flow Modeling in VHDL
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
VHDL 표현방식.
George Mason University Data Flow Modeling of Combinational Logic ECE 545 Lecture 5.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Combinational logic circuit
Basic Language Concepts
Describing Combinational Logic Using Processes
Dataflow Style Combinational Design with VHDL
ENG6530 Reconfigurable Computing Systems
Combinational Circuits Using VHDL
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL Description 1. Behavioral Description (동작묘사)
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL VHSIC Hardware Description Language VHSIC
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL (VHSIC Hardware Description Language)
VHDL Structural Architecture
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Modeling of Circuits with a Regular Structure
Data Flow Description of Combinational-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
CprE / ComS 583 Reconfigurable Computing
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
4-Input Gates VHDL for Loops
Digital Logic with VHDL
Presentation transcript:

VHDL의 기본 Lecture #6

3. VHDL 모델링

VHDL 모델링 방법 추상적 동작 표현(Behavioral Descriptions) 알고리즘방법으로 표현 데이터 흐름 표현(Dataflow Descriptions) 부울대수를 이용해서 표현 구조적 표현(Structural Descriptions) 단순한 선의 연결로 표현 혼합적 표현(Mixed Descriptions) 위의 3가지방법을 혼합 VHDL의 기본

Behavioral Descriptions 동작적 표현 방식 논리회로의 동작에 대한 기능적 또는 알고리즘적 표현 논리회로에 대한 최상위 추상화 레벨 논리회로의 내부 구조에 대한 지식을 요구하지 않음 고급언어를 사용한 프로그램 작성방법과 유사 자료보관과 관리가 편리 process() 문을 주로 사용하여 표현 Process 문장 자체는 병행 문장  process 문장간에는 병행 수행 Process 문장 내에서는 순차 실행 VHDL의 기본

Behavioral Description - Signal Assignment, Conditional 2 x 1 Multiplexer : library ieee; use ieee.std_logic_1164.all; entity mux21_when is port( a,b : in std_logic; s : in std_logic; y : out std_logic); end mux21_when; architecture a of mux21_when is begin y <= a when (s='0') else b; end a; 2x1 Mux a b s y 동작 명세: if s = 0 then y = a else y = b 마지막 조건은 else 로 처리해야 함 VHDL의 기본

Behavioral Description - Signal Assignment, Conditional VHDL의 기본

Behavioral Description - Signal Assignment, Selected library ieee; use ieee.std_logic_1164.all; entity mux21_with is port( a, b: in std_logic; s : in std_logic; y : out std_logic); end mux21_with; architecture a of mux21_with is BEGIN WITH s SELECT y <= a WHEN ‘0’, b WHEN others; END a; 마지막 조건은 else 로 처리해야 함 VHDL의 기본

Behavioral Description – Sequential Statement (IF) library ieee; use ieee.std_logic_1164.all; entity mux21_if_proc is port( a,b : in std_logic; s : in std_logic; y : out std_logic); end mux21_if_proc; architecture proc of mux21_if_proc is begin process(a,b,s) if( s='0') then y<=a; else y<=b; end if; end process; end proc; a, b,s 에 변화생길 때 실행 마지막 조건은 else로 처리해야 함. VHDL의 기본

Behavioral Description – Process Statement (case) library ieee; use ieee.std_logic_1164.all; entity mux21_case_proc is port( a,b : in std_logic; s : in std_logic; y : out std_logic); end mux21_case_proc; architecture proc of mux21_case_proc is begin process(a,b,s) case s is when '0' => y<= a; when others => y<= b; end case; end process; end proc; 마지막 조건은 others로 처리해야 함. VHDL의 기본

Behavioral Description – Signal vs. Variable library ieee; use ieee.std_logic_1164.all; entity andor_2 is port( a, b, c : in std_logic; y : out std_logic); end andor_2; architecture a of andor_2 is begin process(a,b,c) variablel t : std_logic; t :=a and b; y<=t or c; end process; end a; library ieee; use ieee.std_logic_1164.all; entity andor_2 is port( a, b, c : in std_logic; y : out std_logic); end andor_2; architecture a of andor_2 is signal t : std_logic; begin process(a,b,c,t) t<=a and b; y<=t or c; end process; end a; 선언되는 위치차이 Sensitivity List차이 2 1 1 Signal t는 Process문이 끝나는 순간에 일괄적으로 값이 할당. 2 3 Variable은 대입 즉시 값 할당. VHDL의 기본

Dataflow Descriptions 데이터 흐름 표현 입력과 출력과의 관계를 기술한 부울 대수식을 이용한 설계 방식 논로회로를 구성하는 구성 요소의 입출력 그리고 구성 요소간의 신호 흐름을 묘사하는 방식으로 논리회로를 설계 논리회로에 대한 중간 수준의 추상화 레벨 문장의 순서는 무관하다 병행처리문(Concurrent Statement)를 주로 사용 VHDL의 기본

Dataflow Description - 2-입력 AND Gate Library ieee; Use ieee.std_logic_1164.all; Entity and_2 is port( a, b : in std_logic; y : out std_logic ); end and_2; Architecture dataflow of and_2 is begin y <= a and b; end dataflow; Dataflow방식은 부울대수를 그대로 표현 VHDL의 기본

Dataflow Description - 2입력 OR Gate Library ieee; Use ieee.std_logic_1164.all; Entity or_2 is port( a, b : in std_logic; y : out std_logic ); end or_2; Architecture dataflow of or_2 is begin y <= a or b; end dataflow; VHDL의 기본

Dataflow Description - Andor_2 Circuit library ieee; use ieee.std_logic_1164.all; entity andor_2 is port( a, b, c : in std_logic; y : out std_logic); end andor_2; architecture a of andor_2 is signal t : std_logic; begin t<=a and b; y<=t or c; end a; VHDL의 기본

Dataflow Description – 4 bits OR gate Bus의사용 library ieee; use ieee.std_logic_1164.all; entity or_4bits is port( a, b : in std_logic_vector(3 downto 0); y : out std_logic_vector(3 downto 0) ); end or_4bits; architecture xxx of or_4bits is begin y <= a or b; end xxx; VHDL의 기본

Dataflow Description - Half Adder library ieee; Use ieee.std_logic_1164.all; Entity half_add is port( a,b : in std_logic; sum, c_out : out std_logic ); end half_add; Architecture dataflow of half_add is begin sum <= A xor B; c_out <= A and B; end dataflow; 문장의 순서는 무관 VHDL의 기본

Dataflow Description - Full Adder library ieee; use ieee.std_logic_1164.all; entity fulladd is port( a, b, cin : in std_logic; s, cout : out std_logic); end fulladd; architecture a of fulladd is signal t1, t2, t3 : std_logic; begin t1 <= a xor b; t2 <= a and b; t3 <= t1 and cin; s <= t1 xor cin; cout <= t2 or t3; end a; t1 t2 t3 문장의 순서는 무관 VHDL의 기본

Dataflow Description - Decoder3_8 library ieee; use ieee.std_logic_1164.all; entity decoder38_data is port( d2, d1, d0 : in std_logic; y0,y1,y2,y3,y4,y5,y6,y7 : out std_logic); end decoder38_data; architecture xxx of decoder38_data is signal nd2, nd1, nd0 : std_logic; Begin nd2 <= not d2; nd1 <= not d1; nd0 <= not d0; y0<= nd2 and nd1 and nd0; y1<= nd2 and nd1 and d0; y2<= nd2 and d1 and nd0; y3<= nd2 and d1 and d0; y4<= d2 and nd1 and nd0; y5<= d2 and nd1 and d0; y6<= d2 and d1 and nd0; y7<= d2 and d1 and d0; end xxx; VHDL의 기본

Structural Descriptions 구조적 표현 논리회로의 구성 요소 및 구성 요소간의 연결까지 표현 가장 하드웨어적 표현에 가까움 Graphic Editor를 이용한 고전적인 설계방식과 동일 Component( ) 문을 이용하여 구성 요소 종류를 선언 Component Instantiation을 통해 구성 요소 객체와 객체간을 연결 정의 Port map( ) 문을 이용하여 핀들을 서로 연결. 위치결합(positional association) Port문 내의 Signal의 위치순서대로 나열 이름결합(named association) Port문 내의 Signal의 위치순서와는 상관없이 (port문 내의 형식이름=>실제 이름)의 방식으로 결합 VHDL의 기본

Structural Description - Andor_2 library ieee; use ieee.std_logic_1164.all; entity andor_2 is port( a, b, c : in std_logic; y : out std_logic); end andor_2; architecture a of andor_2 is component and_2 port( a, b : in std_logic; y : out std_logic ); end component; component or_2 signal t : std_logic; begin U1 : and_2 port map ( a, b, t ); U2 : or_2 port map( a=> t, b=>c , y=>y); end a; and_2.vhd, or_2.vhd는 미리 작성된 상태임. And_2선언 Or_2선언 Component Instantiation VHDL의 기본

Structural Description - Andor_2 library ieee; use ieee.std_logic_1164.all; entity andor_2 is port( a, b, c : in std_logic; y : out std_logic); end andor_2; architecture a of andor_2 is component and_2 port( a, b : in std_logic; y : out std_logic ); end component; component or_2 signal t : std_logic; begin U1 : and_2 port map ( a, b, t ); U2 : or_2 port map( a=> t, b=>c , y=>y); end a; And_2 :위치결합방식 Or_2 : 이름결합방식 형식이름 VHDL의 기본 실제이름

Structural description – 4 bits adder tcout1 library ieee; use ieee.std_logic_1164.all; entity add_4bits is port( a, b : in std_logic_vector(3 downto 0); cin : in std_logic; sum : out std_logic_vector(3 downto 0); cout : out std_logic ); end add_4bits; architecture a of add_4bits is component fulladd port( a, b, cin : in std_logic; s, cout : out std_logic); end component; signal tcout1, tcout2, tcout3 : std_logic; begin U1 : fulladd port map( a(0), b(0), cin, sum(0), tcout1); U2 : fulladd port map( a(1), b(1), tcout1, sum(1), tcout2); U3 : fulladd port map( a(2), b(2), tcout2, sum(2), tcout3); U4 : fulladd port map( a(3), b(3), tcout3, sum(3), cout); end a; tcout2 tcout3 Fulladd.vhd는 미리 작성된 상태임 VHDL의 기본

Structural Description - Mux 8X1 Library ieee; Use ieee.std_logic_1164.all; entity mux8_1 is port( a, b, c, d, e, f, g, h : in std_logic; s2, s1, s0 : in std_logic; y : out std_logic); end mux8_1; architecture xxx of mux8_1 is component decoder3_8 port( a, b, c : in std_logic; d0,d1,d2,d3,d4,d5,d6,d7 : out std_logic); end component; signal t : std_logic_vector(7 downto 0); signal d0,d1,d2,d3,d4,d5,d6,d7 : std_logic; begin U1: decoder3_8 port map( s2,s1,s0,d0,d1,d2,d3,d4,d5,d6,d7); t(0) <= a and d0; t(1) <= b and d1; t(2) <= c and d2; t(3) <= d and d3; t(4) <= e and d4; t(5) <= f and d5; t(6) <= g and d6; t(7) <= h and d7; y <= t(0) or t(1) or t(2) or t(3) or t(4) or t(5) or t(6) or t(7); end xxx; t(0) t(1) t(2) t(3) t(4) t(5) t(6) t(7) Decoder3_8.vhd는 미리 작성된 상태임 Mixed Modelling : structure + dataflow VHDL의 기본

Structural Description – 4bits Mux 8X1 Library ieee; Use ieee.std_logic_1164.all; Entity mux81_4bits is port( a, b, c, d, e, f, g, h : in std_logic_vector(3 downto 0); s2, s1, s0 : in std_logic; y : out std_logic_vector(3 downto 0)); end mux81_4bits; Architecture a of mux81_4bits is component mux8_1 port( a, b, c, d, e, f, g, h : in std_logic; s2, s1, s0 : in std_logic; y : out std_logic); end component; begin U0: mux8_1 port map (a(0),b(0),c(0),d(0),e(0),f(0),g(0),h(0),s2,s1,s0,y(0)); U1: mux8_1 port map (a(1),b(1),c(1),d(1),e(1),f(1),g(1),h(1),s2,s1,s0,y(1)); U2: mux8_1 port map (a(2),b(2),c(2),d(2),e(2),f(2),g(2),h(2),s2,s1,s0,y(2)); U3: mux8_1 port map (a(3),b(3),c(3),d(3),e(3),f(3),g(3),h(3),s2,s1,s0,y(3)); end a; VHDL의 기본