Introduction to Counter in VHDL

Slides:



Advertisements
Similar presentations
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.
Advertisements

Synchronous Sequential Logic
Table 7.1 Verilog Operators.
Flip-Flops, Registers, Counters, and a Simple Processor
Counter Circuits and VHDL State Machines
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
Counters Mano & Kime Sections 5-4, 5-5. Counters Ripple Counter Synchronous Binary Counters –Design with D Flip-Flops –Design with J-K Flip-Flops Counters.
ENGIN112 L20: Sequential Circuits: Flip flops October 20, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 20 Sequential Circuits: Flip.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
CS370 Counters. Overview °Counter: A register that goes through a prescribed series of states °Counters are important components in computers. °Counters.
Lab 5 :JK Flip Flop and Counter Fundamentals:
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
Three Other Types of Counters (BCD Counter, Ring Counter, Johnson Counter) Hun Wie (Theo) SJSU, 2011 Spring Prof: Dr. Sin-Min Lee CS147 Computer Organization.
A presentation on Counters
Chapter 1_4 Part II Counters
Lecture 27 Counters Give qualifications of instructors: DAP
Asynchronous Counters with SSI Gates
Introduction to VHDL (part 2)
Advanced FPGA Based System Design Lecture-9 & 10 VHDL Sequential Code By: Dr Imtiaz Hussain 1.
ECE 2372 Modern Digital System Design
Tutorial 1 Combinational Logic Synthesis. Introduction to VHDL VHDL = Very high speed Hardware Description Language VHDL and Verilog are the industry.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
1 Sequential Logic Lecture #7. 모바일컴퓨팅특강 2 강의순서 Latch FlipFlop Shift Register Counter.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
displayCtrlr Specification
CascadedBCDCntr&Display Aim : Capture, simulate and implement a 2-digit, loadable BCD up/down counter, with chip enable I/P (CE) and chip enable O/P (CEO).
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Introduction to Sequential Logic
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Counter Circuits and VHDL State Machines
VHDL – Behavioral Modeling and Registered Elements ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Digital System Design using VHDL
Introduction to VHDL Coding Wenchao Cao, Teaching Assistant Department of EECS University of Tennessee.
Latches and Flip-Flops
ENG241 Digital Design Week #7 Sequential Circuits (Part B)
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.
Unit 4 Structural Descriptions SYLLABUS Highlights of Structural descriptions Organization of the Structural descriptions Binding State Machines Generate(HDL),Generic(VHDL),
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
3 BIT DOWN COUNTER SUBJECT: DIGITAL ELECTONICS CODE: COLLEGE: BVM ENGINEERING COLLEGE COLLEGE CODE:008 ELECTRONICS & TELECOMMUNICATION DEPT.
Counters In digital logic and computing, a counter is a device which stores (and sometimes displays) the number of times a particular event or process.
Flip-Flop Flip-flops Objectives Upon completion of this chapter, you will be able to :  Construct and analyze the operation of a latch flip-flop made.
Sequential statements (1) process
FLIP FLOPS Binary unit capable of storing one bit – 0 or 1
Supplement on Verilog FF circuit examples
Week #7 Sequential Circuits (Part B)
Figure 7.1 Control of an alarm system
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
EKT 124 / 3 DIGITAL ELEKTRONIC 1
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part III A workshop by Dr. Junaid Ahmed Zubairi
Sequential Circuit: Counter
Flip-Flop.
Instructor: Alexander Stoytchev
Sequential-Circuit Building Blocks
Asynchronous Counters with SSI Gates
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
SYNTHESIS OF SEQUENTIAL LOGIC
VHDL (VHSIC Hardware Description Language)
EET107/3 DIGITAL ELECTRONICS 1
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
Flip Flops Unit-4.
14 Digital Systems.
Sequntial-Circuit Building Blocks
System Controller Approach
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Electronics and Logic Design
(Sequential-Circuit Building Blocks)
Presentation transcript:

Introduction to Counter in VHDL CLASS MATERIALS EECE 255

Counter In electronics, counters can be implemented quite easily using register-type circuits such as the flip-flop, and a wide variety of designs exist, e.g.: Asynchronous (ripple) counters Synchronous counters Johnson counters Decade counters Up-Down counters Ring counters There are several ways to create counter circuits, such as using T flip-flop, D flip-flop, JK flip-flop. In this class, we will introduce a simply way to write code in VHDL for the counter.

VHDL Example: Gated D Latch The code in Figure 7.36 defines an entity named latch, which has the inputs D and Clk and the output Q. The process uses an if-then-else statement to define the value of the Q output. When Clk=1, Q takes the value of D. When Clk = 0, Q will retain its current value in this case, and the code describes a gated D latch. The process sensitivity list includes both Clk and D because these signals can cause a change in the values of the Q output.

VHDL Example: D Flip Flop This is a example for a positive-edge-triggered D flip-flop. The process sensitivity list contains only the clock signal because it is the only signal that cause a change in the Q output. The syntax Clock’EVENT uses a VHDL construct called an attribute. With condition Clock = 1, here it means that ”the value of the Clock signal has just changed, and the value is now equal to 1”, which refers to a positive clock edge.

VHDL Example: D Flip Flop This process uses the statement WAIT UNTIL Clock’EVENT AND Clock=‘1’. This statement has the same effect as the IF statement. However, the process sensitivity list is omitted. In our use of VHDL, which is for synthesis of circuits, a process can use a WAIT UNTIL statement only if this is the first statement in the process.

VHDL Example: Synchronous Clear Here is a example shows how a D flip-flop with a synchronous reset input can be described. In this case, the reset signal is acted upon only when a positive clock edge arrives.

VHDL Example: A Four Bit Up-counter Resetn: Reset input E: enable input In the architecture body the flip-flops in the counter are represented by the signal named Count If E=1, the count is incremented If E=0, the code explicitly assigns Count<=Count The O outputs are assigned the values of Count at the end fo the code.

Introduction to Clock In electronics and especially synchronous digital circuits, a clock signal is a signal used to coordinate the actions of two or more circuits. A clock signal oscillates between a high and a low state and is usually in the form of a square wave.

Slow down the Clock The Basys board includes a primary, user-settable silicon oscillator that produces 25MHz, 50MHz, or 100MHz based on the position of the clock select jumper at JP4. However, the high frequency will make the seven segment display looks like on all the time, and the eyes of human can not distinguish the change. One way to slow down the clock frequency is to write a DivClk.vhd file, with the help of IF-ELSE statement and a variable to count the high frequency signal to generate a low freqency signal.

Structure Descriptions in VHDL Once we have defined the basic building blocks of our design using entities and their associated architectures, we can combine them together to form other designs.

Structure Descriptions in VHDL The port map clause specifies what signals of the design to connect to the interface of the component in the same order as they are listed in the component declaration. The instance connects clk_in to clock, rst to resetn, E to E, and count to Q. In Xilinx ISE, you can right click on a certain vhdl file and choose set as top module. Combined with component declaration and port mapping,

The end In this project, the AN3, AN2, AN1, AN0 are the ID of the four digits display. You will need to figure out a way to output the two digit number on the 7-seg display VHDL Reference: Textbook, Appendix A.11 Common Errors in VHDL Code. Advise: Start early and have fun!