Lab 05 Sen Ma.

Slides:



Advertisements
Similar presentations
VHDL 5 FINITE STATE MACHINES (FSM) Some pictures are obtained from FPGA Express VHDL Reference Manual, it is accessible from the machines in the lab at.
Advertisements

Tutorial 2 Sequential Logic. Registers A register is basically a D Flip-Flop A D Flip Flop has 3 basic ports. D, Q, and Clock.
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Registers and Counters. Register Register is built with gates, but has memory. The only type of flip-flop required in this class – the D flip-flop – Has.
28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
ECE-C 302 Lecture Data Storage Prawat Nagvajara Stack: Last-in First-out (LIFO) Queue: First-in First-out (FIFO) Random Access Memory.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
VHDL revision 15a1 VHDL revision. VHDL revision 15a2 Q1 A clocked 4-to-2-bit encoder circuit (with synchronous reset) has the following interfaces: RESET:
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
Latches and Flip-Flops Discussion D4.1 Appendix J.
CS370 Counters. Overview °Counter: A register that goes through a prescribed series of states °Counters are important components in computers. °Counters.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Memory in FPGAs مرتضي صاحب الزماني. Inferring Memory Inferring Memory in XST:  Distributed or block memory? −XST implements small RAM components on distributed.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
SAP1 (Simple-As-Possible) Computer
Designing with FPGAs ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
System Arch 2008 (Fire Tom Wada) /10/9 Field Programmable Gate Array.
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
Chapter 14 Introduction to Microprocessors. 2 Microcomputer A self-contained computer system that consists of CPU (central processing unit), memory (RAM.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ENG241 Digital Design Week #8 Registers and Counters.
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)
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis Aleksandar Milenkovic
Joachim Rodrigues, EIT, LTH, Introduction to Structured VLSI Design VHDL IV Introduction to Structured VLSI Design - VHDL IV Joachim Rodrigues.
11/17/2007DSD,USIT,GGSIPU1 RTL Systems References: 1.Introduction to Digital System by Milos Ercegovac,Tomas Lang, Jaime H. Moreno; wiley publisher 2.Digital.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Introduction to Computer Design n Memory n Review of simple processor and memory n Fetch and execute cycle n Processor organization n Executing instructions.
Feb. 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 12: State Elements, Registers, and Memory * Jeremy R. Johnson Mon. Feb.
1 MIPS VHDL Overview Reference: VHDL Tutorial on CDROM, or Accolade Reference Guide Notes: / / pdf / MIPS_vhdl_notes.pdf.
Dale & Lewis Chapter 5 Computing components
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
CDA 4253 FGPA System Design Xilinx FPGA Memories
Digital System Design using VHDL
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Chapter 6 – Digital Electronics – Part 1 1.D (Data) Flip Flops 2.RS (Set-Reset) Flip Flops 3.T Flip Flops 4.JK Flip Flops 5.JKMS Flip Flops Information.
ECE 545—Digital System Design with VHDL Lecture 1
July 2, 2001Systems Architecture I1 Systems Architecture II (CS 282) Lab 3: State Elements, Registers, and Memory * Jeremy R. Johnson Monday July 2, 2001.
Figure 9.1 Architecture of a Simple Computer System.
Sequential Logic Flip-Flop Circuits By Dylan Smeder.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Lecture 11 Xilinx FPGA Memories Part 2
VHDL Models For Memory And Busses 구 본 진.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
Combinational logic circuit
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Class Exercise 1B.
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Registers and Counters
B e h a v i o r a l to R T L Coding
Part II A workshop by Dr. Junaid Ahmed Zubairi
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Revision Name __________ Student number______
Latches and Flip-flops
Figure 9.1 Architecture of a Simple Computer System.
Field Programmable Gate Array
Field Programmable Gate Array
Review of Aldec Active HDL Implementing Combinational
ECE 545 Lecture 17 RAM.
Founded in Silicon Valley in 1984
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
Presentation transcript:

Lab 05 Sen Ma

What is a Register ? “In computer architecture, a register is a small amount of storage available as part of a CPU. ” --Wikipedia

What is Register ? “In computer architecture, a register is a small amount of storage available as part of a CPU. ” --Wikipedia Data in the Random-access memory (RAM)

What is Register ? “In computer architecture, a register is a small amount of storage available as part of a CPU. ” --Wikipedia Data in the Random-access memory (RAM) Registers are stored in a structure called a register file which impalement by using RAM.

Assume we have 10 registers. What is Register ? Reg_File Register File’s name R0 0x0000 R1 0x0001 R2 R3 R4 R5 R6 R7 R8 R9 Assume we have 10 registers. R0 ~ R9 Each register has 16bits. Another assumption R0 = 0 and R1 = 1 (forever)

Oh Yeah, we have registers! We can design our own instructions What is Register ? Reg_File Oh Yeah, we have registers! R0 0x0000 R1 0x0001 R2 R3 R4 R5 R6 R7 R8 R9 We can design our own instructions How about this: R2 = R0 + R1

Oh Yeah, we have registers! We can design our own instructions What is Register ? Reg_File Oh Yeah, we have registers! R0 0x0000 R1 0x0001 R2 R3 R4 R5 R6 R7 R8 R9 We can design our own instructions How about this: R2 = R0 + R1 R2 = R0 + R1

Oh Yeah, we have registers! We can design our own instructions What is Register ? Reg_File Oh Yeah, we have registers! R0 0x0000 R1 0x0001 R2 R3 R4 R5 R6 R7 R8 R9 We can design our own instructions How about this: R2 = R0 + R1 R2 = R0 + R1

What is Register ? Reg_File Oh Yeah, we have registers! 0x0000 R1 0x0001 R2 R3 R4 R5 R6 R7 R8 R9 We can design our own instructions How about this: R2 = R0 + R1 R2 = R0 + R1 We have already know the assembly language: R2 = R0 + R1 add R2, R0, R1

What is Register ? Reg_File One more! add R3, R1, R2 R0 0x0000 R1

What is Register ? Reg_File One more! add R3, R1, R2 R0 0x0000 R1

You can think about the Reg_File is an Array. What is Register ? Reg_File R0 0x0000 R1 0x0001 R2 R3 0x0002 R4 R5 R6 R7 R8 R9 Behind the scene: You can think about the Reg_File is an Array. When you read from or write in the register, it is same operation on an array which you have already know.

1 step, Read R1: Reg_File[1] What is Register ? Register File’s name (array’s name) Reg_File R0 0x0000 R1 0x0001 R2 R3 0x0002 R4 R5 R6 R7 R8 R9 Same Example: add R3, R1, R2 1 step, Read R1: Reg_File[1]

1 step, Read R1: Reg_File[1] 2 step, Read R2: Reg_File[2] What is Register ? Reg_File R0 0x0000 R1 0x0001 R2 R3 0x0002 R4 R5 R6 R7 R8 R9 Same Example: add R3, R1, R2 1 step, Read R1: Reg_File[1] 2 step, Read R2: Reg_File[2]

What is Register ? Reg_File Same Example: add R3, R1, R2 1 step, Read R1: Reg_File[1] 2 step, Read R2: Reg_File[2] 3 step Add Reg_File[1] + Reg_File[2]

What is Register ? Reg_File Same Example: add R3, R1, R2 1 step, Read R1: Reg_File[1] 2 step, Read R2: Reg_File[2] 3 step Add Reg_File[1] + Reg_File[2] 4 step, Write R3: Reg_File[3] = Reg_File[1] + Reg_File[2]

Define an array in VHDL: Register in VHDL Define an array in VHDL: type ram_type is array (15 downto 0) of std_logic_vector(15 downto 0); Reg_File R0 0x0000 R1 0x0001 R2 R3 0x0002 R4 R5 R6 R7 R8 R9

Define an array in VHDL: Register in VHDL Define an array in VHDL: type ram_type is array (15 downto 0) of std_logic_vector(15 downto 0); Reg_File Define a type named “ram_type” which is a array with 16 item. Each item is a 16bits vector R0 0x0000 R1 0x0001 R2 R3 0x0002 R4 R5 R6 R7 R8 R9

Register in VHDL Define an array in VHDL: type ram_type is array (15 downto 0) of std_logic_vector(15 downto 0); signal Reg_File : ram_type; Reg_File R0 0x0000 R1 0x0001 R2 R3 0x0002 R4 R5 R6 R7 R8 R9 Using the “ram_type” to define a signal named “Reg_File”.

Define an array in VHDL: Reg_File(3) <= Reg_File(1) + Reg_File(2); Register in VHDL Define an array in VHDL: type ram_type is array (15 downto 0) of std_logic_vector(15 downto 0); signal Reg_File : ram_type; Reg_File R0 0x0000 R1 0x0001 R2 R3 0x0002 R4 R5 R6 R7 R8 R9 Same Example: add R3, R1, R2 Reg_File(3) <= Reg_File(1) + Reg_File(2);

Register clk clear A_addr A_data load b_addr c_addr b_data c_data

Register Entity Register is port( clk: in std_logic; -- positive edge triggered clock clear: in std_logic; -- asynchronous reset a_addr: in std_logic_vector( 3 downto 0); -- input data port a_data: in std_logic_vector(15 downto 0); -- register select for input a load: in std_logic; -- load enable b_addr: in std_logic_vector( 3 downto 0); -- register select for output b c_addr: in std_logic_vector( 3 downto 0); -- register select for output c b_data: out std_logic_vector(15 downto 0); -- first output data port c_data: out std_logic_vector(15 downto 0) -- second output data port ); End Register;

Register Requirements: Create a register file. It should have 16 registers, each being sixteen bits wide. When the load signal is asserted, a rising edge on clk cause the data on a_data to be stored in the register identified by a_addr. If the load signal is not asserted, a rising clock edge has no effect. The data on b_data should be the contents of the register identified by b_addr. The data on c_data should be the contents of the register identified by c_addr. Register 0 always contains the value 0. Writing to register 0 is ignored. Register 1 always contains the value 1. Writing to register 1 is ignored. When the clear signal is 0, all registers (other than register 1) are reset to 0. Note that this is asynchronous. Follow the instruction on page 129~130 in Xilinx XST User Guide, reference the example code to implement your own register file.