ECE-C 302 Lecture 15 Prawat Nagvajara

Slides:



Advertisements
Similar presentations
ECE-C 302 Lecture Data Storage Prawat Nagvajara Stack: Last-in First-out (LIFO) Queue: First-in First-out (FIFO) Random Access Memory.
Advertisements

Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
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.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Decoders and Encoders Lecture L4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.
Integer Square Root.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
Introduction to VHDL (part 2)
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
ENG241 Digital Design Week #8 Registers and Counters.
Basic Overview of VHDL Matthew Murach Slides Available at:
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)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
ECE-C302 Serial Addition – A Finite State Machine 1. Serial Parity Checker 2. Decimal Serial Adder 3. Radix r Serial Adder.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
Digital System Projects
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
VHDL Project I: Serial Adder Matthew Murach Slides Available at:
Lecture 8 Review Combinational Devices –Decoder –Multiplexor (Bhasker p-81) –Shifter –Barrel Shifter (Bhasker p-303)
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
1 AL and CA Lecture 13: System Design 1 2 Outline System Level Design Control Signals Controller Design.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Combinational logic circuit
Describing Combinational Logic Using Processes
Registers and Counters
Part III: SYSTEM DESIGN
Hardware Description Languages
Maj Jeffrey Falkinburg Room 2E46E
Part IV: VHDL CODING.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Sequential-Circuit Building Blocks
ECE 331 – Digital System Design
HDL Programming Fundamentals
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
A Data Stack CoreGen Discussion 12.1.
VHDL (VHSIC Hardware Description Language)
ECE 448 Lecture 13 Multipliers Timing Parameters
Chapter 5 – Number Representation and Arithmetic Circuits
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 331 – Digital System Design
Data Flow Description of Combinational-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
Figure 8.1. The general form of a sequential circuit.
UNIT 6: Mixed-Type Description
Data Flow Description of Combinational-Circuit Building Blocks
Data Stack and Return Stack
Modeling Complex Behavior
Modeling of Circuits with Regular Structure
Sequntial-Circuit Building Blocks
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
High-Low Guessing Game
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

ECE-C 302 Lecture 15 Prawat Nagvajara Odometer Design Stack Design First-in First-out (FIFO) Design

--Below is a behavioral description of an --Odometer Design --Below is a behavioral description of an --odometer that counts in radix 10, e.g. it --counts from 000000 to 999999   Package odom_pack is Subtype my_integer is integer range (0 to 9); Type integer_array is array (natural range <>) of my_integer; end odom_pack; library ieee; use ieee.std_logic_1164.all, work.odom_pack; Entity odometer is Generic (N: natural := 6); --number of digits Port(ck,reset : in std_logic; Z : out integer_array(n-1 downto 0)); End odometer;

Architecture behav of odometer is Begin Process(ck) Variable carry : std_logic; Variable temp : integer_array(n-1 downto 0); If reset = ‘1’ then temp := (others => 0); Else Carry := ck; -- we increment the least -- significant digit Temp(0) on ck rising-edge For I in 0 to n-1 loop If Carry = ‘1’ then Temp(i) := (Temp(i) + 1) mod 10; If Temp(i) = 0 then Carry := ‘1’; else Carry := ‘0’; End if; End if; End loop; Z <= Temp; -- wire internal states to outputs End process; End behav;

… Temp (n-1) Temp(1) Temp(0) Ck Z(n-1) Z(1) Z(0) We wish to design a structural description architecture of the odometer by first designing the cell and then wiring the cells, using structural description, (i.e. for-generate construct), together as in the diagram above.

Entity cell is Port( C_in, reset : in std_logic; C_out : out std_logic; Y : out integer); End cell; Architecture behav of cell is Begin Process(C_in, reset) Variable temp: my_integer; If reset=‘1’ then temp := 0; Elsif reset=‘0’ and C_in=‘1’ and C_in’event then temp := (temp+1)mod 10; if temp = 0 then c_out<=1; else c_out<=0; end if; End if; Y <= temp; --wire memory to output End process; End behav;

Architecture struc of odom is Signal temp: std_logic_vector(0 to n-2); Component cell Port( C_in, reset : in std_logic; C_out : out std_logic; Y : out integer); End component; Begin G1: for I in 0 to n-1 generate G2: if I=0 generate PE:cell port map(ck,reset,temp(I),z(I)); end generate G2; G3: if I>0 and I<n-1 generate PE:cell port map(temp(I-1),reset,temp(I),z(I)); end generate G3; G4: if I=n-1 generate PE:cell port map(temp(I-1),reset,open,z(I)); end generate G4; End generate G1; End struc;

Stack or Last-in First-out (LIFO) Stack Base = 0xFFFF Location (Address) 0xFFE7 0xFFE8 0xFFE9 0xFFFA 0xFFFB 0xFFFC 0xFFFD 0xFFFE 0xFFFF Top-of-Stack Pointer

After 5 pops and a push Location (Address) 0xFFE7 0xFFE8 0xFFE9 0xFFFA 0xFFFB 0xFFFC 0xFFFD 0xFFFE 0xFFFF Top-of-Stack Pointer

FIFO Initially the FIFO is empty Location 1 2 3 4 5 6 7 0 (end around) Front Ptr Rear Ptr

After a Write Location 1 2 3 4 5 6 7 0 (end around) Front Ptr Rear Ptr

After three more Writes Location 1 2 3 4 5 6 7 0 (end around) Front Ptr Rear Ptr

After Two Reads Location 1 2 3 4 5 Front Ptr 6 7 0 (end around) 1 2 3 4 5 6 7 0 (end around) Front Ptr Rear Ptr

And Two More Reads The Queue is Empty (Front = Rear) Location 1 2 3 4 5 6 7 0 (end around) Front Ptr Rear Ptr

After Eight Writes The Queue is Full (Rear = Front) Location 1 2 3 4 5 6 7 0 (end around) Front Ptr Rear Ptr