16-bit ALU, Register File and Memory Write Interface



Similar documents
ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

Computer organization

CHAPTER 11: Flip Flops

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Modeling Latches and Flip-flops

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

(Refer Slide Time: 00:01:16 min)

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

Chapter 2 Logic Gates and Introduction to Computer Architecture

Registers & Counters

Modeling Registers and Counters

5 Combinatorial Components. 5.0 Full adder. Full subtractor

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

Lab 1: Introduction to Xilinx ISE Tutorial

Decimal Number (base 10) Binary Number (base 2)

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

After opening the Programs> Xilinx ISE 8.1i > Project Navigator, you will come to this screen as start-up.

Microprocessor & Assembly Language

MICROPROCESSOR AND MICROCOMPUTER BASICS

Generating MIF files

The 104 Duke_ACC Machine

Serial Communications

Counters and Decoders

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

ECE 451 Verilog Exercises. Sept 14, James Barnes

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Lab 1: Full Adder 0.0

Register File, Finite State Machines & Hardware Control Language

State Machines in VHDL

MS Visual C++ Introduction. Quick Introduction. A1 Visual C++

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

Debouncing Switches. Mechanical switches are one of the most common interfaces to a uc.

Two's Complement Adder/Subtractor Lab L03

A Verilog HDL Test Bench Primer Application Note

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

CSE 141L Computer Architecture Lab Fall Lecture 2

CS311 Lecture: Sequential Circuits

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

A New Paradigm for Synchronous State Machine Design in Verilog

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

MACHINE ARCHITECTURE & LANGUAGE

A Program for PCB Estimation with Altium Designer

LAB4: Audio Synthesizer

EC313 - VHDL State Machine Example

Computer Organization and Components

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

Combinational Logic Design Process

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

1. Product Information

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

Part I. The Picture class

Mentor Tools tutorial Bold Browser Design Manager Design Architect Library Components Quicksim Creating and Compiling the VHDL Model.

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

Digital Design with VHDL

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

Technical Aspects of Creating and Assessing a Learning Environment in Digital Electronics for High School Students

MAX II ISP Update with I/O Control & Register Data Retention

Packet Tracer 3 Lab VLSM 2 Solution

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Module 3: Floyd, Digital Fundamental

ModelSim-Altera Software Simulation User Guide

Systems I: Computer Organization and Architecture

RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

BINARY CODED DECIMAL: B.C.D.

Start Active-HDL by double clicking on the Active-HDL Icon (windows).

DEPARTMENT OF INFORMATION TECHNLOGY

9/14/ :38

Let s put together a Manual Processor

An Introduction to MPLAB Integrated Development Environment

Physics 226 FPGA Lab #1 SP Wakely. Terasic DE0 Board. Getting Started

Designing VM2 Application Boards

The WIMP51: A Simple Processor and Visualization Tool to Introduce Undergraduates to Computer Organization

VHDL Test Bench Tutorial

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Quartus II Software Design Series : Foundation. Digitale Signalverarbeitung mit FPGA. Digitale Signalverarbeitung mit FPGA (DSF) Quartus II 1

Online Backup Client User Manual Linux

ENGI E1112 Departmental Project Report: Computer Science/Computer Engineering

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Lesson 1 - Creating a Project

Designing a Schematic and Layout in PCB Artist

Tutorial: Configuring GOOSE in MiCOM S1 Studio 1. Requirements

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

Interfacing Analog to Digital Data Converters

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

Flip-Flops, Registers, Counters, and a Simple Processor

Final Project: Enhanced Music Synthesizer and Display Introduction

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Cadence Verilog Tutorial Windows Vista with Cygwin X Emulation

1 Description of The Simpletron

Transcription:

CS M152B Fall 2002 Project 2 16-bit ALU, Register File and Memory Write Interface Suggested Due Date: Monday, October 21, 2002 Actual Due Date determined by your Lab TA This project will take much longer time than the previous one. The three components you are building in the project will be put all together and program to the board to be tested. The three components do not depend on each other. Therefore, I suggest you to start them in parallel. The only thing that prevents you from fully parallelizing the work is because there is only one workstation for each group. So, you should consider how to fully utilizing your resources (your team members and the workstation) to finish this project soon. However, keep in mind that you should know how to build each component even if you are not participating in building some of the components. PART 0 In project 1, the & and functions are specified as logical, they should be bitwise. They are meant to be bitwise if you look at the expected test results. Sorry for the confusion. Now, do a modification to the 4-bit ALU built in project 1. Add the complement (bitwise NOT) operation. The control signal is 110 for NOT. Make sure your 4-bit ALU is built with minimum area. The chip area is measured in SLICEs. The chip has 768 SLICEs available. You can check the number of SLICEs used in your design from the Place & Route Report. The TA s implementation used 10 SLICEs for the 4-bit ALU. PART 1 16-Bit ALU Design You are asked to build a 16-bit asynchronous ALU that can do addition, subtraction, bitwise AND, bitwise OR, increment, decrement, bitwise NOT, shifting, and comparison. The top level schematic is shown in the following figure. Page 1 of 7

A(15:0) Cout zero S(15:0) B(15:0) ALUctrl(3:0) The following is the functional truth table. ALU Ctrl Function 0000 S = A + B 0001 S = A B 0010 S = A & B (bitwise AND) 0011 S = A B (bitwise OR) 0100 S = A + 1 0101 S = A 1 0110 S = ~A (complement) 1100 S = A << B(3:0) (logical shift) 1110 S = A >> B(3:0) (logical shift) 1000 S = A << B(3:0) (arithmetic shift) 1010 S = A >> B(3:0) (arithmetic shift) 1001 If (A < B) S = 1 else S = 0 * The output zero is 1 when S is 0, otherwise zero is 0. * Be aware that the control signal is now 4 bits wide. * The shifting must be asynchronous (i.e. can t use shift register); the shifting distance range is between 0 and 15. * The ripple-carry is used between the 4-bit ALUs. * Your first priority is to minimize the area of your design; second priority is performance (delay) * You are welcome to use Schematic VHDL CORE IP Your previous project or any combination of the above Page 2 of 7

Hint: You can t put 4 copies your project 1 together plus some other components to build this 16- bit ALU. You can use it as the least significant 4-bit of the ALU but it requires some modifications for the most significant 12-bit of the ALU. Think about the A+1 and A-1 cases. One of the design choices of the shifting is barrel shifter. The (A < B) comparator can be done by a subtraction with the ALU. Simulation With ModelSim, simulate each function with some numbers for A and B of your choice just to make sure that it really works. PART 2 Register File Design You are asked to build a register file with eight 16-bit registers. It should have two read ports and one write port. The top level schematic is shown below. Ra Rb Rw WrEn busw Reg. File busa busb * busa, busb and busw are each 16 bits wide; Ra, Rb, and Rw are each 3 bits wide. * it works as the following: busa <= R[Ra]; busb <= R[Rb]; when WrEn is 1, R[Rw] <= busw at next clock cycle; * R[0] always holds value of 0; * Your first priority is to minimize the area of your design; second priority is performance (delay) * You are welcome to use Schematic VHDL CORE IP or any combination of the above Page 3 of 7

Suggestion: use FD16CE symbol as a single register to start building the register file. Simulation With ModelSim, simulate writing/reading values to/from the register file to make sure that it really works. PART 3 Memory Write Interface Design In order to write to the SRAM using the provided VHDL file sraminterfacewithpportsv01.vhd, you need to implement the protocol specified in page 3 of tutorial 2. The module that implements the protocol is referred as the Memory Interface here. Basically, the Memory Interface is a state machine. Therefore you need to understand the protocol and implement the state machine to interact with the provided VHDL module to write data. The following is the top level schematic of the memory interface and the sraminterfacewithpport-sv01.vhd module. IssueWrite resetl CanWrite DoWrite Memory Write Interface (to be built) WriteAddr WriteData Sraminterfacewithpportsv02.vhd (provided) WriteDone Memory Write Interface Module Inputs : ResetL (active low; to initial state) IssueWrite; CanWrite; Outputs: DoWrite; WriteDone; Page 4 of 7

* The interface should work according to the following: When writing a data, within the same clock cycle do { send the data on WriteData; send the addr on WriteAddr; assert the IssueWrite } after some number of clock cycles, the WriteDone signal goes high, meaning the write operation is done. * You can use Behavioral VHDL as long as it can be synthesis and other tools as usual to implement state machine. Simulate With ModelSim, verify the state transition goes correctly in your state machine design. Putting it all together Now, you should have a working 16-bit ALU, a register file and a memory write interface. Let s create a top level schematic that put all of these together like the following figure. Ra Rb Control Module provided by TA SelectL button WriteL button Reg. File busa ALU Ctrl Clk ResetL IssueWr NextWr Addr zero Memory write interface issuewrite resetl WriteDone canwrite dowrite Rw WrEn BusW busb ALU WriteAddr WriteData ALU Ctrl sraminterfacewithpport Go to My Network Places\Computers Near Me\152b-lab-01\Project2Files folder, copy all files to your local project directory. They includes the Control Module (TACM) and the sraminterfacewithpport files. Page 5 of 7

This circuit will allow you to do an ALU operation on two registers and write the result back into a register as well as write to the memory, from where you can dump to check the result. PIN allocation: a single reset input connect to the resets of the control module, the memory write interface and the sraminterfacewithpport module; this single reset <= push button 1 (remember, all reset should be active low) a single input connect to the of all modules that has the inputs. This single <= usual pin. Control Module o SelectL button(active low) <= push button 4 o WriteL button(active low) <= push button 3 Register File (because we only have 8 dip switches, the MS bit of Rb is forced to 1 ) o Ra(2:0) <= dip switch(1:3) o Rb(1:0) <= dip switch(4:5) o Rw <= dip switch(6:8) Make an output bus from ALUCtrl o ALUCtrl(3:0) <= bar LED(9:6) And don t forget to connect the pins for the sraminterfacewithpport o the left bank SRAM ldata(15:0) laddr(18:0) lcen loen lwen o the parallel port ppdata(7:0) ppstatus(6:3) Program to the Board and Test After you finish this top level schematic, you can simulate it with ModelSim (optional). Then you need to program it to the board. Testing Procedure: 1. Press the push button 1 to reset. 2. Flip to dip switches to select the operands and the destination register. 3. Repeat pressing the push button 4 to select an ALU function of your choice (the control code of the operation is shown on bar LED (9:6) 4. Press the push button 3 to write 5. Dump the memory contents to the screen. 6. If you want to test more, go back to step 2. Page 6 of 7

Project Report Describe your design for PART 1-3. Report the number of SLICEs used for each part (1-3) separately. (the SLICEs information can be found in the Place & Route Report) Report the Maximum Net Delay of each part (1-3) separately. (the Delay information can be found in the Asynchronous Delay Report) The End of Project 2. General Hints in Using the Tools If you need to put a lot of the same components in the schematic, put one first, draw wires to all inputs/outputs. Then select this component and all the wires by drawing selecting square. Then copy & paste. You can get 1, 2, 4, 8, 16, 32 of the same components with wires fast by repeating copy & paste. (Notice that the copy and paste will not copy the wire name) When you backup your file, you should select Project -> Delete Implementation Data, then select Project-> Archive to create a zip file. You can unzip a file from the DOS prompt by unzip [zipfile] d [directory] (Notice that if you delete the implementation data, you need to redo the Synthesize and Implement steps to your design in order to program to the board. Components generated from COREgen IP tend to take up more SLICEs than the symbols from the library. In schematic, two wires are connected if they have the same name even they appear to be not connected in the editor. As the design gets big, it will make the schematic really messy if all the wires are connected. Another thing is that you don t need to use any bus trap. Just name a wire called ABC(2:0), and name other wires ABC(0), ABC(1), ABC(2). Then they are connected just like there were the bus traps. Page 7 of 7