Digital Systems Laboratory 1 IE5 / WS 2001

Similar documents
hochschule fu r angewandte wissenschaften hamburg Prof. Dr. B. Schwarz FB Elektrotechnik/Informatik

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Electrical and Telecommunications Engineering Technology_TCET3122/TC520. NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Registers

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

Microprocessor Design

Laboratory Exercise 7

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

LFSRs as Functional Blocks in Wireless Applications Author: Stephen Lim and Andy Miller

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS 150 Spring 2000

Chapter 2. Digital Circuits

CPS311 Lecture: Sequential Circuits

Main Design Project. The Counter. Introduction. Macros. Procedure

Experiment 8 Introduction to Latches and Flip-Flops and registers

Administrative issues. Sequential logic

1. Convert the decimal number to binary, octal, and hexadecimal.

Counter dan Register

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

Logic Design. Flip Flops, Registers and Counters

Main Design Project. The Counter. Introduction. Macros. Procedure

CHAPTER 6 COUNTERS & REGISTERS

Experiment # 12. Traffic Light Controller

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

CSE 352 Laboratory Assignment 3

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

Universal Asynchronous Receiver- Transmitter (UART)

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Review : 2 Release Date : 2019 Last Amendment : 2013 Course Code : SKEE 2742 Procedure Number : PK-UTM-FKE-(0)-10

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

Final Exam review: chapter 4 and 5. Supplement 3 and 4

Logic Design II (17.342) Spring Lecture Outline

Laboratory 4. Figure 1: Serdes Transceiver

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

DO NOT COPY DO NOT COPY

Review of digital electronics. Storage units Sequential circuits Counters Shifters

Other Flip-Flops. Lecture 27 1

CHAPTER 4: Logic Circuits

MUHAMMAD NAEEM LATIF MCS 3 RD SEMESTER KHANEWAL

Flip-flop and Registers

You will be first asked to demonstrate regular operation with default values. You will be asked to reprogram your time values and continue operation

Digital Fundamentals: A Systems Approach

Scanned by CamScanner


Figure 1: segment of an unprogrammed and programmed PAL.

Chapter 5 Synchronous Sequential Logic

CSE 275 Digital Design Lab Lab 8 Serial Adder/Subtractor Penn State Erie, The Behrend College Fall Semester 2007 Number of Lab Periods: 2

Task 4_B. Decoder for DCF-77 Radio Clock Receiver

Digital Logic Design ENEE x. Lecture 24

MODULE 3. Combinational & Sequential logic

Registers and Counters

Chapter 8 Registers & Counters

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

FPGA Design. Part I - Hardware Components. Thomas Lenzi

VeriLab. An introductory lab for using Verilog in digital design (first draft) VeriLab

Chapter 7 Counters and Registers

COE328 Course Outline. Fall 2007

0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 1 1 Stop bits. 11-bit Serial Data format

LSN 12 Shift Registers

Side Street. Traffic Sensor. Main Street. Walk Button. Traffic Lights

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

ECE 263 Digital Systems, Fall 2015

Faculty of Electrical & Electronics Engineering BEE3233 Electronics System Design. Laboratory 3: Finite State Machine (FSM)

CHAPTER1: Digital Logic Circuits

TSIU03, SYSTEM DESIGN. How to Describe a HW Circuit

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

Registers and Counters

Decade Counters Mod-5 counter: Decade Counter:

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

Combinational / Sequential Logic

Laboratory Exercise 7

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Chapter 3 Unit Combinational

CHAPTER 4: Logic Circuits

Module -5 Sequential Logic Design

ECE337 Lab 4 Introduction to State Machines in VHDL

Inside Digital Design Accompany Lab Manual

CARLETON UNIVERSITY. Facts without theory is trivia. Theory without facts is bull 2607-LRB

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

Logic Design Viva Question Bank Compiled By Channveer Patil

CS8803: Advanced Digital Design for Embedded Hardware

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

ECSE-323 Digital System Design. Datapath/Controller Lecture #1

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Asynchronous (Ripple) Counters

Combinational vs Sequential

Advanced Digital Logic Design EECS 303

Counters

Lecture 6: Simple and Complex Programmable Logic Devices. EE 3610 Digital Systems

Sequential circuits. Same input can produce different output. Logic circuit. William Sandqvist

Report on 4-bit Counter design Report- 1, 2. Report on D- Flipflop. Course project for ECE533

Synchronous Sequential Logic

TMEL53, DIGITALTEKNIK. INTRODUCTION TO SYNCHRONOUS CIRCUITS, FLIP-FLOPS and COUNTERS

Synchronous Sequential Design

Transcription:

Digital Systems Laboratory 1 IE5 / WS 2001 university of applied sciences fachhochschule hamburg FACHBEREICH ELEKTROTECHNIK UND INFORMATIK digital and microprocessor systems laboratory In this course you are going to work out four labs. The topics of the labs relate directly to the corresponding course DS. The digital designs have to be developed and implemented in hardware with XILINX-Foundation software tool. The design entry will be performed with VHDL coding. All developments will be implemented with XILINX-CPLD XC9500 hardware. This outline gives information about the recommended reading, the necessary lab preparation, the work library of the development PCs and the final documentation. You will have to work with the following handouts: 1. Lab descriptions which are listed in the table. 2. Instructions to handle XILINX-Foundation. This is a red line paper with information about the software icons you have to choose for design development steps. 3. Instructions to work with the VHDL simulator ModelSim XE. 4. Course handout XILINX XC9500 CPLD Device Architecture. Survey to four labs during WS 2001 (please remark the special time scheduling for November/December): Lab no. Topic 1 Design of a traffic light controller for a pedestrian crossing. Lab goals: Implementation of a finite state machine (FSM) in interconnection with a controlled counter. 2 Design of a controlled 8-bit shift register. Lab goals: Implementation of a parallel-load / serial-parallel converter. 3 Design of a 8-bit serial two's complementer. Lab goals: Implementation of a synchronously clocked system which consists of four connected components. 4 Design of a simple controller/data path architecture for the serial two's complementer which receives a 10-bit input word: start bit, 8 data bits, stop bit. Lab goals: Implementation of a digital system which is build up by components and handshake interfacing: FSM controller and a data path unit (DPU). Recommendations for lab preparation! Each lab has to be prepared appropriately in order that you are able to: present a written/drawn concept for the digital circuit, present a VHDL model (compiled *.vhd file on a disk) for the design you have to implement, present a concept for the hardware verification. Important notes which have to be reminded during the labs: Start to login to the lab PC with the local PC name (DIP<number of PC>). You don t need to login with a password. You have to copy your VHDL design files into the work directory C:\Fndtwrk. You are not allowed to change any existing path or implement any new work directory. With each start of the PC a new work directory c:\fndtwrk will be created. This prepared work directory contains several useful files (*.ucf; seg7.vhd;*.do; *.cmd). You should not expect that your development results will be available on the PC at the next day. Therefore you should use the file fi archive project option in XILINX-Foundation tool. Please remember that VHDL filenames and the including entity names should be identically in order to avoid misunderstandings of information yielded by the software tools. You have to choose entity, project, and command file names with less or equal 8 characters, because otherwise design implementation may cause problems. No a, u, o are allowed for proper operation. 1 SWR 01 1

During all labs the development results have to be verified by VHDL or timing simulations before design implementation will be tested. You have to edit appropriate *.cmd or *.do command files because design debugging will be more efficient. Guide through the lab records (write-ups): Each lab has to be accomplished by a documentation. Following parts should be included: You have to explain the development of block diagrams, decision charts, state diagrams, ASM charts, logic functions and VHDL code semantics. The meaning of all VHDL signals and variables have to be made plausible, i. e. with identically named interconnection lines in a speaking block schematic. In order to convince with your lab results you have to add comments on all command files, simulation timings, with which you have tested your design. We also expect comments on all element groups of the schematics or logic equations (i. e. combinational logic, unexpected latches, flip-flops and three-state drivers). Pinout of the implemented digital circuit. Finish the lab documentation with a schematic of the complete test system (device under test, signal generator and oscilloscope). 2

university of applied sciences fachhochschule hamburg FACHBERCH ELEKTROTECHNIK UND INFORMATIK digital and microprocessor systems laboratory Student group: Professors comment: Record editor: Date: Group members: Professor: 1. Lab: Traffic Light Controller The controller for traffic lights at a pedestrian crossing has to be developed. A pedestrian who wants to cross a road has to push a button (PB) at a traffic light sign post. A sequence of light changes gives green or red lights to the pedestrian (PEGR, PDRE) and green, yellow or red lights to the drivers directions (DRGR, DRYE, DRRE). The sequence of traffic light states is described with table 1. The number of cycles of a chosen clock period determines the duration of each state. A sequence controller has to be build up with a synchronous Mealy state machine. The FSM will be switched on State PB Function Cycles DRRE DRYE DRGR PDRE PDGR S0 0 Initial state, waiting 0 0 0 0 0 S1 was 1 Push button has been pressed, system switched on 5 0 0 1 1 0 S2 X Drivers direction yellow 2 0 1 0 1 0 S3 X Drivers dir. red 5 1 0 0 1 0 S4 X Pedestrians dir. green 30 1 0 0 0 1 S5 X Pedestrians dir. red 10 1 0 0 1 0 S6 X Drivers dir. red/yellow 2 1 1 0 1 0 S7 X Drivers dir. green 15 0 0 1 1 0 Table 1: Sequence of traffic light states and number of clock cycles. with the pedestrians push button PB. The duration of each state has to be controlled by a synchronous 5-bit counter (Q[4:0]). Parallel to the next state calculation (Si / Si+1) the counter is reset synchronously by the FSM output CLR. In order to reduce the number of CPLD macrocells a state encoding has to be chosen which is described by the following state diagram. reset Reset 0xxxx/0 x00100/1 x00001/1 x00100/1 1xxxx/0 x00100/0 x00001/0 000000 000110 001010 010010 x01110/0 100110 x00001/0 111010 x01001/0 110010 x11101/0 110001 x01110/1 x00001/1 x01001/1 x11101/1 B 5 DRRE DRYE DRGR PDRE PDGR PB Q4 Q3 Q2 Q1 Q0/ CLR 3

The development should begin with a block diagram which describes all interfaces of two components. Both components have to be modelled and tested separately. The traffic controller system has to be described then with a structural model which contains instantiations of both components. Template of a structural model with components: -- Template for a structural model entity TRAFFIC_CONTROL is -- external ports. port(reset, CLK, PB : in bit; OUTP : out bit_vector(4 downto 0)); end TRAFFIC_CONTROL; architecture STRUCTURE of TRAFFIC_CONTROL is signal CLR_I: BIT; signal Q_I: BIT_VECTOR(4 downto 0); -- component-declaration: used IC-type component COUNTER_T_C port( CLR, CLK : in BIT ; QOUT : out BIT_VECTOR ); end component; component LIGHT_CONT -- light controller Mealy-FSM port( RESET, PB, CLK : in BIT ; COUNT : in BIT_VECTOR(4 downto 0); CLR : out BIT ; LIGHTS: out bit_vector(4 downto 0)); end component; begin -- component instantiation: socket interfacing INST_1: COUNTER_T_C -- connector of component => internal signal or external interface port map(clr => CLR_I, CLK => CLK, QOUT => Q_I); INST_2: LIGHT_CONT port map(reset => RESET, PB => PB, CLK => CLK, COUNT => Q_I, CLR => CLR_I, LIGHTS => OUTP); end STRUCTURE; Single Steps Develop a 5-bit counter VHDL code with a synchronous reset and symbolic signal delays (after 20 ns) in signal assignments. Counter Develop a two-process FSM model VHDL code. FSM Develop a structural VHDL model as described above. Synthesis and design implementation. Apply implementation options : Simulation: ModelSim VHDL Timing simulation with ModelSim and check the signal propagation from clock edge to selected outputs. Build up the device under test with an XS-95 board. Connect the control signals to the traffic light model. Measurements of signal propagation delay has to be performed. Documentation VHDL code and a corresponding decision chart. VHDL code and a block diagram. VHDL code and corresponding block diagram. Pin out and comments on logic equations, check the *.rpt file. result print out and comments on worst case signal delays. Hand drawing of used equipment and measured signals. The results have to be explained to the professor or to the technical assistant. 4

university of applied sciences fachhochschule hamburg FACHBERCH ELEKTROTECHNIK UND INFORMATIK digital and microprocessor systems laboratory Student group: Professors comment: Record editor: Date: Group members: Professor: 2. Lab: 8-Bit Parallel-Load Shift Register A Johnson counter contains the basic structure of a shift register which is made up by a chain of D-FFs. Beginning with the LSB of a register (a number of D-FFs) each D-FF output can be connected to the data input of the D-FF with next higher weight. This chain of D-FFs includes the ability to shift the bits of the register to the left (LSB to MSB) or to the right (MSB to LSB). For example, a sequence of bits can be converted into a word by shifting the bits into a register and moving the bits along at each clock edge. After a sufficient number of clock edges, namely the number n of D-FFs, the n bits of a word are available as a single word. This is known as serial-in, parallel-out register. During the shift processing all bits which have been stored before will be lost. Applications of shift registers will be found in serial communication interfaces. The receiver input device will clock in a data stream of sequenced bits and a parallel word will be accessed by internal processes. A sender will clock out a parallel stored word over a serial register output. Simple multiply and division operations can be performed by a shift register. A multiplication by two will be done with a shift left by one bit. A VHDL-module which models a shift register type SN74HC166 has to be implemented with a CPLD XC95108 (compare attached TI data sheet pages). Describe the main functionality with a clocked process. The priority of control inputs is described by the data sheet function table. Start with development of a decision chart which resumes following order of input signal checking: 1. Asynchronous and low active clear. 2. Clock edged check of an internal signal which is build up with an ORing of two inputs clock CLK and clock inhibit CLK INH. 3. Synchronous load with SH_LD_N = 0. 4. Shift enable with SH_LD_N = 1. Shift of serial input SER from LSB to MSB output QH which means shift left. Therefore you should use the label SEL for serial data input. Additional requirements: 1. All 8 register bits should be accessible at the module output. 2. Append a controlled tristate output driver to the all register outputs. The enable signal should be EN. In order to apply a high impedance state the IEEE-library has to be included to the VHDL code (compare counter lab DC I) and the signal type std_logic has to be used. Implementation advice: The shift left operation can be done by taking the lowest (8-1) bits of Q[7:0] and concatenating the serial input bit SEL to the LSB position and assign it to Q[7:0]. Pseudo-random generator (PSRG, compare J. Wakerly: Digital Design; page 730-733): Another shift register or ring counter application that is simple in terms of next state logic is the linear feedback shift register (LFSR). The next state logic is formed by XOR gates. The sequence of states appears to be random. In order to avoid a stop of sequence an appropriate set condition has to be applied and a self correcting circuit has to be connected to the load input. 5

Single Steps Develop a shift register VHDL code according to the datasheet. Append a tri-state driver process to the shift register VHDL code. Develop a LFSR VHDL code with signal feedback from the shift register output. Synthesis and design implementation of the shift register with tri-state outputs. Apply implementation options : Simulation: ModelSim VHDL Timing simulation with ModelSim and check the signal propagation from clock edge to selected outputs. Build up the device under test with an XS-95 board. Connect the shift register signals to an external LED device.. Documentation VHDL code and a corresponding decision chart. VHDL code and a block diagram of both components. VHDL code and block diagram. Pin out and comments on logic equations, check the *.rpt file. result print out and comments on worst case signal delays. Hand drawing of used equipment and measured signals. The results have to be explained to the professor or to the technical assistant. 3. Lab: Serial Two's Complementer 6

university of applied sciences fachhochschule hamburg FACHBERCH ELEKTROTECHNIK UND INFORMATIK digital and microprocessor systems laboratory Student group: Professors comment: Record editor: Date: Group members: Professor: A Mealy state machine (FSM) receives an serial bit stream X which consists of 8-bit blocks without any separating bits. The data bits are supplied to the circuit synchronously beginning with the LSB. Serial two's complementing (X Y) is performed by the FSM according to the following algorithm: Appearing zeros X = 0 will be copied to the output Y= 0. The first detected one X = 1 will also be copied Y = 1. All other following bits after the first one have to be inverted Y = X. Examples : 1. X = 0 1 1 0 0 1 0 1 (LSB) 2. X = 1 1 1 0 0 0 1 0 (LSB) Y = 1 0 0 1 1 0 1 1 Y = 0 0 0 1 1 1 1 0 System operation according to figure 1: The output bit stream Y of the Mealy state machine FSM will be registered by a 8-bit shift register SRG_8 (shift right). After the 8 th bit (MSB) has been shifted into the SRG_8 the full 8-bit data word will be stored by a 8-bit data buffer D_B with the next clock edge. Concurrently to this process of shifting a 3-bit counter C_3B is counting all bits of the received 8-bit blocks. From the counter RCO signal an unknown block? derives the store enable signal LOAD. The unknown function LOAD = f(rco) has to be identified. From the start all synchronously clocked components receive an asynchronous reset. When the sender retrieves the reset it will connect the first LSB to the X input of the FSM. With the next clock edge the 2 nd bit is available and after the MSB has appeared all 8-bit blocks will follow in a closed sequence. X Y 8 8 FSM SRG_8 D_B SHIFT_REG DATA CLK 3 COUNT C_3B RCO? LOAD Figure1: Block diagram of the serial two's complementer with four synchronously clocked components. Lab preparation: a) Develop a Mealy state diagram which describes the two's complementer FSM. Derive a two process state machine VHDL code. b) Develop appropriate VHDL codes for all other components (comp. figure 1) accordingly to the VHDL templates you have experienced during the DC I and DS courses. c) The system verification shall be performed by a synthezisable testbench VHDL code. This testbench SRG_TB is build up by a shift register which shifts out to the left a stream of 24 bits. The MSB of the SRG_TB is connected to the X input of the FSM. The global asynchronous reset is connected to the SRG_TB as well. 7

Single Steps Develop a two process FSM VHDL code. Connect all VHDL codes (figure 1) in one design entity including the testbench shift register Synthesis and design implementation of the complete design entity. Apply implementation options : Simulation: ModelSim VHDL Timing simulation with ModelSim. Build up the device under test with an XS-95 board. Connect the DATA signal vector and the LOAD signal to an external LED device. Documentation VHDL code and the corresponding state diagram. VHDL codes. Table with a proof of the two's complementer operation. Pin out and comments on logic equations, check the *.rpt file. result print out and comments on worst case signal delays. Hand drawing of used equipment and measured signals. The results have to be explained to the professor or to the technical assistant. 8

university of applied sciences fachhochschule hamburg FACHBERCH ELEKTROTECHNIK UND INFORMATIK digital and microprocessor systems laboratory Student group: Professors comment: Record editor: Date: Group members: Professor: 4. Lab: Controller/ Path Architecture The serial two's complementer we have dealt with in lab 3 has to be completed in order to develop a more practical receiver device for synchronous communication. Now the data bit stream consists of 10 bits: 1 start bit (low level), 8 data bits (LSB first), 1 stop bit (high level) (comp. figure 1). If the sender line is deactivated the line level will be high X = 1. With this kind of defined bit frame the receiver operation can be designed more self controlled. CLK bits Start bit bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 Stop bit Figure 1: bit frame with a leading start bit (low level) and an appended stop bit (high level). Now the FSM can become the controller of all receiver system components (comp. figure 1 lab 3). A beginning communication is identified by the FSM with a first high low transition on X. With the next clock edge the FSM will perform a transition from its waiting state to the receiving state. With the transition to the receiving state the FSM will set the enable signals to the bit counter C_B and to the shift register SRG_8. When the bit counter has incremented up to 8 all data bits have been shifted into the SRG_8. With the counter state 8 and a stop bit high level is identified the load signal to the data buffer D_B can be set immediately by the FSM. The 8 data bits will be loaded into the data buffer with the next clock edge and a FSM state transition to the waiting state takes place. If no correct stop bit appears no loading will happen and the shifted data will be lost. In such a case an error signal can be send back to the sender. During the waiting state a synchronous reset signal is generated by the FSM and connected to the bit counter and the shift register. Lab preparation: a) Draw a block diagram with all interfacing between the FSM controller and all other components of the data path. The bit counter RCO signal should be connected to the FSM which reduces the number of interface lines. Mark control and status signals. b) Develop a state diagram which describes the two's complementer FSM with additional control outputs. Derive a two process state machine VHDL code. c) Develop appropriate VHDL codes for all other components of the drawn block diagram. d) The system verification shall be performed by a synthezisable testbench VHDL code. This testbench SRG_TB is build up by a shift register which shifts out to the left a stream of 24 bits. The MSB of the SRG_TB is connected to the X input of the FSM. The global asynchronous reset is connected to the SRG_TB as well. 9

Single Steps Develop a two process FSM VHDL code. Connect all VHDL codes (block diagram) in one design entity including the testbench shift register Synthesis and design implementation of the complete design entity. Apply implementation options : Simulation: ModelSim VHDL Timing simulation with ModelSim. Build up the device under test with an XS-95 board. Connect the DATA signal vector, the LOAD signal and the state D-FF outputs to an external LED device. Documentation Block diagram of the controller/data path structure. FSM VHDL code and the corresponding state diagram. VHDL codes. Table with a proof of the two's complementer operation. Pin out and comments on logic equations, check the *.rpt file. result print out and comments on worst case signal delays. Hand drawing of used equipment and measured signals. The results have to be explained to the professor or to the technical assistant. 10