Digital System Design Using VHDL 8.2
Digital System Design Using VHDL 8.2
Digital System Design Using VHDL 8.2
By:
Bijay_Kumar Sharma
By:
Bijay_Kumar Sharma
Online:
< http://cnx.org/content/col11213/1.8/ >
CONNEXIONS
Rice University, Houston, Texas
This selection and arrangement of content as a collection is copyrighted by Bijay_Kumar Sharma. It is licensed
under the Creative Commons Attribution 3.0 license (http://creativecommons.org/licenses/by/3.0/).
Collection structure revised: April 1, 2013
PDF generated: April 3, 2013
For copyright and attribution information for the modules contained in this collection, see p. 178.
Table of Contents
1 EC1561_Syllabus of Digital System Design using VHDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Digital System Design_Chapter 1_Part 1-Historical Background of IC
Technology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Digital System_Design_Chapter 1_Part 2_Introduction to VLSI . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 DSD_Chapter 2_Basics of PLDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5 Digital System Design_Chapter 2_Section 2_Wishlist of Digital System
Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6 DSD_Chapter 3_VHDL._introduction and content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7 DSD_Chapter 4_VHDL application to combinatorial logic synthesis . . . . . . . . . . . . . . . . . . . . . . 75
8 DSD_Chapter 4_VHDL application to sequential logic synthesis . . . . . . . . . . . . . . . . . . . . . . . . . . 91
9 DSD_Chapter 4_VHDL application to Sequential Circuit Synthesis_Part2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10 Chapter 5_ DSD_Moore and Mealy State Machines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
11 DSD_Chapter 5_StateMachines_Part3_MooreMachine Motor Rotation Sensor Design and Synthesis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
12 DSD_Chapter 5_Part 3_Design of a Mealy Machine_Rotation_Sensor . . . . . . . . . . . . . . . . . 149
13 DSD_Chapter 5_Supplement_Optical TERA BUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
14 DSD_Chapter 6_Mighty Spartans in Action_Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
15 DSD_Chapter 6_Mighty Spartans in Action_Part 1_Digital Instruments_Clocks+Scoreboard+the like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Attributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
iv
Chapter 1
1. VHDL for Designers, Stefan Sjoholm & Lennart Lindh, Prentice Hall.
2. Principles of Digital System Design using VHDL, Roth John, CENGAGE Learning,2010.
1 This
CHAPTER 1.
Chapter 2
Just after the invention of transistors in the end of 1947 and the beginning of 1948, Solid
State Devices gradually started supplanting Vacuum Tubes . Vacuum Tubes became
obsolete because of large size, large electrical power consumption and higher cost. This
marked the dawn of Solid State Era. Today by and large Vacuum Tubes have been
totally replaced by Solid State Devices except in RF and Microwave Wave very high
power generation and transmission where we are still using triode, pentode, klystron,
magnetron and travelling wave tube.
In 1959, Jack Kilby of Texas Instrument and Robert Noyce of Fairchild integrated a
complete RTL NAND gate on one silicon chip. This marked the birth of Integrated
Circuit Technology. This IC Technology was to have such a deep impact on Engineering
in particular and on Human Society in general that it ushered in the Third Wave of
Civilization(rst wave of civilization was ushered in by agriculture and animal husbandry
1 This
CHAPTER 2.
and second wave of civilization was ushered in by James Watt Steam Engine) and Third
Information Revolution (rst information revolution was marked by the invention of alphabets by Phoenicians and second information revolution was triggered by the invention
of Rotating Printing Press by Guttenburg, a German Technician).
Table 1. Growth of level of integration with the development and innovation in lithographic
techniques and in the various processing steps in IC manufacture
IC
SSI
Year
1960
App.
MSI
LSI
VLSI
100-1,000
1,000-10,000
10,000-100,000
Registers, Filters
1965
Microprocessor, ADC
1970
Memory,Computers,Signal 1975
Processors
U LSI
100,000- 40,000,000
Pentium IV.
40,000,000-50,000,000
Dual
Core
2001
and
Quad
2010
Core Procesors.
Table 2.1
Figure 2.1
Figure 1. Magnied view of the circuit layout on microprocessor chip 4004-the rst P chip
introduced in 1971.
IC Era (from SSI to VLSI)
IC in 1960s:
IC in 2010s:
CHAPTER 2.
1995
1998
2001
2004
2007
2010
0.35
0.25
0.18
0.13
0.10
0.07
64M
256M
1G
4G
16G
64G
Microprocessor transistor/chip
12M
28M
64M
150M
350M
800M
ASIC(Gate/Chip)
5M
14M
26M
50M
210M
430M
300
450
600
800
1000
1100
3.3
2.5
1.8
1.5
1.2
0.9
80
100
120
140
160
180
Table 2.2
Figure 2.2
With the
development of `DualCore' and `QuadCore' processors transistor count is exceeding 50 million and reaching
50billion integration density. At this level of complexity System Level Description (SystemC) Language is
used.
The introduction of HDLs and SystemC have made possible the design of complete system on chip (SOC),
with the complexities rising from 1 million to 10 million transistors. Recently system C has been introduced
for 100 million to 1000 millions of transistors.
IC Design Growth at frequency level
Figure 2.3
Figure 3.
Increase in Clock Rate with vertical and lateral scaling of the devices by increased level of
packing density.
The clock frequency increased for high performance microprocessor and industrial microcontroller with
vertical and lateral scale down. Here Motorola microcontroller has been taken as the example, used for high
performance automotive industry applications.
IC Microprocessor Growth
CHAPTER 2.
Figure 2.4
Figure 2.5
Evolution of Lithography
CHAPTER 2.
10
Figure 2.6
Figure 6.Improvment in minimum feature size resolution with advancement in Lithography Technique.
Micron region of lithography is when the smallest feature size is from 10m to 1m.
Submicron region is when smallest feature size is from 1m to 0.1m.
Deep submicron region is when smallest feature size is 0.1m to 0.01m(or 100nm to 10nm)
Ultra Deep submicron region is when smallest feature size is 0.01m to 0.001m (or 10nm to 1nm).
Over the years Lithography has undergone through phases of development progressively resolving smaller
feature sizes . In 1962 we had contact printing, then we had proximity printing, next projection printing,
followed by Electron-beam lithography, X-Ray lithography, G-line lithography, I-line Lithography.
The
resolution of 0.13m was achieved. At 0.13m resolution, 30Mgates could be implemented on 1cm by 1cm
chip.
In 2003 Deep submicron Technology using DUV193nm but an improved source of ArF Excimer in place
of KrF Excimer a resolution of 0.09m.
At 0.09m or 90nm resolution, 100Mgates could be implemented in the same area. In 2005 using the
same light source but introducing immersion technique a further reduction in feature size is achieved namely
of 0.04m. In future with the use of Extreme UV at wavelength of 100nm, the smallest feature size of 0.03m
or less will be achieved.
Ultra Deep submicron Technology will be born when we realize the smallest feature size less than 10nm
which is long way o.
As the lateral feature size has reduced so has the vertical junction depth as is evident from the following
11
Table 3.
Table 3. Dimension Scaling in MOSFET over the last decade.
MOS
1967
1997
1999
2001
2003
2006
L(m)
10
0.25
0.18
0.13
0.1
0.07
2
DRAM(Gb/cm )
64k
0.18
0.38
0.42
0.91
1.85
1000
100
70
60
52
40
Interconnection pitch(nm)
2000
600
500
350
245
130
Table 2.3
Figure 2.7
When the smallest feature size is 1.2m then a simple 2 Input NAND gate occupies 600m .
When the smallest feature size is 0.35m then a simple 2 Input NAND gate occupies 230m .
When the smallest feature size is 0.12m then a simple 2 Input NAND gate occupies 100m .
2
When the smallest feature size is 0.09m then a simple 2 Input NAND gate occupies 40m .
CHAPTER 2.
12
much higher cost because of the complexity of processing involved at smaller and smaller feature size.
Lithography mask cost doubles for every next generation and design team becomes larger.
Table 4. Team size growth with the complexity of the circuit.
Year
1970
1990
2010
50,000ForASIC
500,000ForFPGA
Table 2.4
Figure 2.8
Figure 8. Silicon Chip mounting on the ceramic header and ceramic dual-in-line package plugged in IC
socket which in turn is connected to the Printed Circuit Board.
Moore's Law has become a yardstick of our progress as we harness the cunning of NATURE's design strategies.
13
Figure 2.9
CHAPTER 2.
14
Figure 2.10
Figure 10. An ultra- clean room of IC manufacturing plant where all the workers are
covered in Nylon Aprons from top to bottom to keep out the dust they may be carrying.
Intel Pentium II Microprocessor
15
Figure 2.11
The processor speed has increased 10 times from Pentium in 1993 to Pentium III in 1999 but with the
introduction of Core2Duo in 2006 to Corei7 in 2013 the core speed has increased 1.5 times only but the need
for high speed computing is increasing exponentially. So obviously this paradigm of core computing will not
be able to keep up with the computing needs of the post-industrial era. So new computing paradigms will
have to be invented.
One of them is Memristor as a circuit element whose resistance drops as current ows through it. HP
and South Korean Firm Hynia are expected to launch next year the rst memristor based Memory Chips
as a replacement of Flash Memory which has the least access time presently. Toshiba has announced the
availability of its 0.165m page-mode 64Mb and 128Mb NOR Flash memories that feature a random access
time of 60ns and page access time of 20ns.
handheld applications that require high-performance memory, the devices operate from 2.3V to 3.6V, and
draws 55mA when reading, 15mA for program/erase functions, and 1mA during standby. The memristor
will provide the alternative to Flash Memory in the coming days.
The second possibility is that Graphene based Device may be marketed as the displays in Smart Phones.
Graphene though a product of low-tech has high-tech performance. Flatland of Graphene is Alice's Wonderland.
Microelectronics engineers are paying attention to Graphene Technology. In semiconductor heterostructures used to make FET devices, for instance, it takes million-dollar epitaxy machines and exquisite care to
tie up dangling surface bonds and eliminate impurities in quantum wells. The preparation minimizes the
scattering of electrons against interfaces and defects to ensure the largest electron mean-free paths in the
device. But this hi-tech processing requires a huge investment in infrastructure.
But in graphene devices comparable or even better results can be achieved at a much lower cost. 1
thick graphene: scientists have a material that is relatively defect free and whose electrons have a respectable
CHAPTER 2.
16
mean-free path naturally, without materials manipulation and processing. Graphene can hardly be more low
tech, and yet it still exhibits high conductivities. It's really counterintuitive and remains to be understood,
comments Geim, but the electron wavefunction appears to localize only parallel to the sheet and does not
interact with the outside world, even a few angstroms away.
A third alternative is optical interconnects. These will speed up in-chip communication. One of these
three technologies may take over the core functions of chip computing thereby provide an alternative
paradigm to core processing.
Android Operating System based Gadgets drive the Consumer Electronics Market
Excerpted from Android baked into Rice Cookers in move past Phones:Tech. The Economic Times, Kolkota,
9th February 2013, Wednesday.
Today Gadgets controlled via Internet have become the trend in Knowledge-based Society. During Agriculture Phase we had Labour-intensive Society. During Industrial Phase we had Capital-intensive Society.
In the present Industrial Phase we have Knowledge-intensive Society.
Google Inc's Android Operating System(OS) has become the most widely used Smart Phones OS. They
hold 72% of the market in the third quarter(Q3) of the nancial year 2012-13. While APPLE OS has 14%
of the market according to Gartner Inc.
Annual Consumer Electronics Show in Las Vegas in 2013 is show casing Android based consumer and
entertainment Gadgets such as:
1. Pico Pix Pocket Projector introduced by Royal Phillips Electronics NV. 2. Smart Thinq Refrigerators
introduced by LG Electronics Inc. 3. Asteroid Car Systems introduced by Parrot S.A. 4. Galaxy Cameras
marketed by Samsung.
Google by extending its OS free to new devices help Google collect data by which it can build more
powerful and lucarative Search Engines.
Android is an easy-to-use-platform that helps appliance makers like Samsung and Phillips to add new
product features and benet from the demand for Internet-connected Devices and Gadgets
IDC (Interational Data Corporation) predicts that total turnover in such smart devices will reach $2Trillion turnover in 2015.
Since Android-based Phones went into sale in 2008, devices based on the mobile OS have surged in
popularity.
Building Android directly into Devices can help control these devices directly via Internet with minimal
human intervention.For example TV may show a pop-up message from a clothes dryer in the basement
indicating the status of the laundry.An Internet-connected rice cooking machine or cooker could set the
cooking instructions itself once it is told the type of rice which has been loaded.
Making intelligent , internet-connected appliances have been the goal of manufacturers for years. Recent
eorts to broaden the use of Android OS beyond phones and computers have yet to take a commercial shape.
Google tried to push into the living room via Google TV product.
The set-top boxes and software for TV made by Sony and Logitech did not meet the sales goal after their
introduction in 2010.
Hisense and Vizu plan to demonstrate models that use an updated version of Android for TV in Las
Vegas Annual Consumer Electronics Show.
Chapter 3
Digital System_Design_Chapter
1_Part 2_Introduction to VLSI
1
EDA) tools.
EDA design tools have reasonably kept pace with designers need as shown in the following chart:
EDA design tools have gone from
Transistors
Gate Level
1 This
17
CHAPTER 3.
18
Figure 3.1
SPLD
CPLD
FPGA
Density
3000 to 5M gates
Timing
predictable
predictable
unpredictable
Cost
Low
Medium
High
Major Vendors
Lattice Sem.;Cypress;AMD;
Xilinx;Altera;
Xil;Alt;Lat.Sem;Actel;
Device families
L.S..GAL16LV8,GAL22V10;
Xil..cool runner,XC9500;
Xil..Virtex,Spartan;
19
Lattice Semiconductor created similar devices with easy programmabilitty and called its line of devices
generic array logic or GAL.
PLAs, PALs, GALs, PLDs and PROM are collectively called Simple Programmable Logic Devices or
SPLD.
When multiple PLDs are put together in the same chip with crossbar interconnection and have the sizes
of 500 to 16000 gates then we achieve Complex Programmable Logic Devices.
In 1980 Xilinx created FPGAs using Static RAM. This integrates a large number of logic. FPGAs donot
have gate array but they have bigger and complex blocks of Static RAM and multiplexers.
Seeing the performance of Xilinx, several PLD vendors and Gate Array Companies jumped into the
market. A variety of FPGA architecture were developed and used. Some are reprogrammable and some are
one-time programmable fuse technologies. In last 15 years FPGAs have grown up to a size of 5 million gates.
Why VLSI ?
Building complex electronic circuit using discrete components are dicult and expensive - Cost depends
on quantity of devices.
CPLD stands for Complex Programmable Logic Device, Advanced version of PLD's.
Here new resources are available such as Flip-Flops, Gates in high number and are able to give functionality
of circuits consisting of few thousand gates and few hundred ip-ops.
FPGA (Field Programmable Gate Arrays) is another programmable resource having very higher programmability than CPLD.
Then there are other higher technology resources (ASIC's) which can be used to design many complex
circuit like microprocessors or bus controllers.
Applications requiring user dened functions like bit processing or DSP algorithm combined with other
computational capabilities.
Thus you are actually designing for emerging and complex Technologies.
VLSI Advantages
1. Reduction in size, power, design, cycle time.
2. Design security.
3. Easy up-gradation.
4. Low cost.
5. Remote Programmability.
6. Long time in market.
VLSI Techniques
VLSI stands for Very Large Scale Integration. This is the technology of putting millions of transistors
into one silicon chip.
CHAPTER 3.
20
Figure 3.2
21
Figure 3.3
CHAPTER 3.
22
Figure 3.4
23
FABRICATION PROSPECT:
1. Chip Design Productivity
2. Chip Design Forecast
3. World Fab Industry Vs Indian Fab Industry
4. Why Fab lab does not exist in India?
5. Challenges before Chip Design and Fab lab
Chip Design Productivity
Figure 3.5
Figure 16. Actual No. of Transistors in millions per IC design. This data illustrates that
there is little correlation between transistors count and engineering eort.
Available for free at Connexions <http://cnx.org/content/col11213/1.8>
24
CHAPTER 3.
Figure 3.6
Figure 3.7
25
6=
According to Indian Semiconductor Association (ISA) quoting the ISA-IDC Report of 2008, by that
year the Semi Conductor activity in India had a turn over of $ 7.37 billion employing over 150,000 highly
qualied professionals. Embedded Software Design constituted a whopping 81% of this activity with VLSI
design being 13% and hardware / board design being 6%.
annually, so we can expect a turnover in excess of $ 12 billion by the end of Year 2010 (employing 180,000+
professionals) of which embedded system design would have a turnover of 10 billion. It is believed that the
global embedded design activity is worth some $25 billion annually. This roughly amounts to India producing
a quarter of the world's embedded design systems. The growth in the design business to the rapid growth
of the Indian Electronics Industry from $363 billion by 2015 at a compounded annual growth rate of some
30%, accounting for 11% of the global market by 2015, projected to grow to $ 155 billion by 2015.
World Fab Industry Vs Indian Fab Industry:
a. Around 50 Fab lab exist in the world, another 50 in near future.
b. First Fab lab by Intel just open in Tiwan, rst in South Asia.
c. No complete VLSI Fab lab in India.
d. SCL, Chandigarh has its own LSI fab lab.
e. Proposal: Rs.1500 crore (for Indian Govt.).
f. Recently, three companies joined forced in Fab industry like: Sem India, HEMC, and Allience Materials.
plete system. The trend towards coding is to write code in C/C++, Matlab/ Java and converted into
HDL/ VERILOG, is not suitable.
2.
Chip Design, reported by New York Times by at Paul Packan, a scientist with
Intel Corp., the world largest chipmaker, said semiconductor engineers have not found ways around
basic physical limits beyond the generation of silicon chips that will begin to appear next year. Packan
called the apparent impasse the most dicult changes the semiconductor industry has ever faced.
CHAPTER 3.
26
These fundamental issues have not previously limited the scaling of transistors, Packan wrote in the Sept.
24 issue of Science. There are currently no known solutions to these problems.
According to Dennis Allison, a Silicon Valley physicist and computer designer, if the miniaturization
process for silicon based transistors is halted, hopes for continued progress would have to be based on new
materials, new transistor designs and advances like molecular
computing , the Times reported. This mystery will be solved ultimately.
Can we meet the challenges of the Future?
[Can you meet the design challenges of 90nm and below?, Electronic Design, 2005]
[Nano-computers, by Phillips J. Kurkes, Gregory S. Snider & R.Stanley William, Scientic American,
November 2005, 72-80.]
Unprecedented manufacturing success has been achieved by enhancing the ability of number crunching,
executing enhanced FLOPS(oating point operations per second)/Instructions per second and by enhanced
data storage capability.
Historically we have moved from labour intensive techniques to capital intensive techniques. Presently
we are witnessing a movement towards knowledge intensive techniques.
Agricultural labour were replaced by proletariate(industrial labour) and proletariate are being replaced
by cognetariate(knowledge worker).
Introduction of computerization, automation and robotization has changed the bench marks of life.
Silicon Industry has become the largest and most inuential industry.
Silicon Industry has become the locomotive of economic development.
Major innovation will be required to reach 10nm feature size. Finding alternative technologies that can
further shrink computing devices is crucial to maintaining technological progress.
Alternative technology
circumvented by building redundancy and by using coding technique. By using Error Correcting Codes the
error rates at the intersection could be drastically reduced.
manufacturing could improve from 0.0001 to 0.9999 if the defect rate is 0.01.
Today Cross Bar Architecture has emerged as the principal contender for a new computing paradigm.
For this success, architecture, device physics and nano-manufacturing techniques need to simultaneously
develop.
Cross Bare Architecture is ideal for implementing strategies based on nding and avoiding defect areas
and using coding theory to compensate for mistakes.
Such switches should be able to scale down to single atom dimension.
Chapter 4
M =
Here
and
may
N =
be less than
In that case each of the M-bit code does not have a corresponding unique
N-bit code. Many of the M-bit codes may have the same N-bit code.
How does the code converter work:
The gure 1 gives the code converter working.
1 This
27
CHAPTER 4.
28
Figure 4.1
29
Figure 4.2
CHAPTER 4.
30
Figure 4.3
Word Line
W0
W1
W2
W3
W4
W5
W6
W7
W8
W9
9
Table 4.1
In Figure 3, for every BCD code one of the 10 Word lines will go HIGH and the remaining lines will be
LOW. Figure 2 tells us that every Word Line is a PRODUCT of 4 Variables A,B,C,D and their complements
A , B ,C ,D .
Encoder Bit Line is SUM of Words.
Keyboard of a Computer generates 8-bit ASCII Code on pressing one of the keys. Hence Keyboard is
ENCODER ARRAY. For simplicity of presentation we present 10Key - 4bit Encoder. The customer will
have to decide and specify the 4-bit codes corresponding to 10 keys. That is the Customer will provide the
Truth Table.
31
W9
W8
W7
W6
W5
W4
W3
W2
W1
W0
Y3
Y2
Y1
Y0
Table 4.2
CHAPTER 4.
32
Figure 4.4
Y0 = D C B A + D C BA + D CB A + D CBA + DC B A;
0
0
0 0
0
0
0
Y1= D C BA + D C BA + D CBA + D CBA;
0
0 0
0
0
0
0
0
Y2= D CB A + D CB A + D CBA +D CBA;
0 0 0
0 0
Y3 = DC B A + DC B A;
33
Figure 4.5
CHAPTER 4.
34
Figure 4.6
between Input Code and Output Word cannot be modied. The Diode Matrix is fabricated at the factory
level. Hence this is Read-Only-Memory (ROM).
35
Figure 4.7
Figure 7.
Multiemitter BJTs are used for transferring `1' from Word-line to Bit-line with which the
intersection is shorted.
Multiemitter BJT has four emitters. When an Emitter is shorted to Bit-line, BJT behaves like Emitter
Follower and as soon as the WORD-line goes HIGH the shorted bit-line ( shorted with the given high
Word-line) goes HIGH and all other bit-lines remain LOW.
According to customer requirement, the manufacturer shorts or opens the intersection by the use of
proper MASK. This is Custom Programming or Mask Programming or Hardware Programming.
This is
sec.
This access time is one order of magnitude longer than that of BJT StaticROM.
In a NMOS or BJT StaticROM we have a DECODER as shown in Figure 8. It has address input or
select input. In this case address word is 10-bit wide. Hence it can access 1024 locations of memory. At
every location a 4-bit wide binary word can be stored as shown in Figure 9. When an address word arrives
, one of the 1024 Word-lines goes HIGH. At any instant only one Word-line can go high.
CHAPTER 4.
36
Figure 4.8
37
Figure 4.9
Figure 9.An NMOS ROM encoder ( Only 5 of the 1024 Word-lines are shown). Small circle means the
intersection is shorted.
In Figure 8, when the following address word is applied:
B9
B8
B7
B6
B5
B4
B3
B2
B1
B0
Table 4.3
Then W0 line goes HIGH. This selects the DATA WORD `0110' in Figure 9.
Let us examine Figure 9 closely:
Q3 and the NMOSs in that ROW are Load FETs. Here Drain and Gate of NMOS have been shorted.
Hence Q3 and its corresponding elements act as loads of the bit-lines Y0,Y1,Y2,Y3.
NMOS has the advantage that it can act in following manners:
i. as a Capacitor when you operate between Gate and Source;
ii. as three terminal active element;
iii. as a non-linear two terminal resistance when Gate and Drain are shorted together.
CHAPTER 4.
38
B9
B8
B7
B6
B5
B4
B3
B2
B1
B0
WORD-line
Y0
Y1
Y2
Y3
W0
W1
W2
W500
Table 4.4
Here the Bits stored are pre-programmed and cannot be changed unless we nd some methods to construct
NMOS and omit NMOS at the 10244 ROM Memory Cells.
What we have shown is a Factory programmed ROM. Field programmed ROM had to wait for several
years before it was introduced as Field Programmable Devices.
39
BCD code
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
9
Table 4.5
In Figure 10 we have shown the construction and the composite structure of 7-SEGMENT DISPLAY.
In Figure 10 it is also shown as to which LED should glow corresponding to a decimal value.
knowledge we can construct the following Table 3 for code conversion.
From this
CHAPTER 4.
40
Figure 4.10
BCD code
Word-line
DCBA
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
Y6
W0= D0 C0 B0 A0
W1= D0 C0 B0 A
W2= D0 C0 BA0
W3= D0 C0 BA
W4= D0 CB0 A0
W5=D0 CB0 A
W6= D0 CBA0
W7= D0 CBA
W8= DC0 B0 A0
W9= DC0 B0 A
Y5
Y4
Y3
Y2
Y1
Y0
41
Table 4.6
lines i.e. W10, W11, W12, W13, W14, W15. Corresponding to these 6 Word-lines there are some arbitrary
SYMBOL displays depending upon the convenience of the Designer.
If all 16 Word-lines are considered then the bit-line Y0 will be by inspection of the Table:
Y0= W1 + W4 + W6 + W10 + W11 + W14 + W15;
By replacing the Word-line by their corresponding Product Term we get:
Y0 = D C B A + CA + DB;
Similarly minimized expressions can be obtained for all the remaining 6 bit-lines.
If using the minimized expressions for Y0, Y1, Y2, Y3 Y4, Y5, Y6 we build the decoder-driver then
almost 20% saving in component count takes place as compared to a decoder-driver built by ROM. It can be
even more. But this will require extra man-hours for minimizing and designing. If the demand can justify
this extra cost then one could go for these especially designed and optimized circuits.
called `Application Specic Integrated Circuits'(ASIC). The `BCD to 7 Segment decoder-driver' presently
available in the market by the component code 74HC4511 is one such ASIC circuits.
42
CHAPTER 4.
Chapter 5
1 This
43
44
CHAPTER 5.
Figure 5.1
45
Figure 5.2
The electron
more able to turn this transistor ON. Hence eectively the NMOS at that intersection is disabled and state
`1' is permanently stored in that cell. Thus by application of 25V at the requisite intersections' FAMOS,
the transistor is disabled and state `1' is permanently stored giving rise to the desired Boolean Function.
Because of SiO2, charges accumulated on Gate2, do not discharge for 10years and longer. The `1s' stored
by application of 25V at Gate2s can be easily erased by exposing the ROM to Ultra-Violet light. UV light
makes the SiO2 slightly conducting thereby providing a path for leakage of charge accumulated on Gate1.
Thus all disabled NMOSs are enabled and this restores EPROM to all `0s' states . This can once again be
reprogrammed and recongured. But this requires long exposure time in excess of 2 minutes for complete
eraser. Hence Electrically erasable and programmable ROM(EEPROM) became the need of the hour.
In 1978, once again the Scientists of INTEL developed and commercialized EEPROM. They reduced the
CHAPTER 5.
46
(100nm) to 100A
pulse was sucient to writ `1s' in a given cell. The same voltage reversed could erase `1' and reset the whole
ROM to `0s'.
Thus we see the Digital Designer's wish list was fullled.
Year
1984
First
PLD
in
the
marketFP300,
320
gates,
1989
1991
1992
1993-94
1995
First FPGA with embedded RAM100k gates, 0.40.3m technology,> 10M components, 50-100Mhz,
First PCI integratedPCI(Peripheral Component Interconnect)
1996-98
1999
First
FPGA
equivalent
to
with
high
100M
speed
input.1.5MGates
transistors,First
embedded
2002-2003
TM High Den-
?Cyclone
Table 5.1
Process
0.35m
0.25um
0.18m
0.15m
0.13m
0.09m
Gate count
500k
1.5M
2.5M
4M
6.5M
10M
150mm
200mm
200mm
200mm
200mm
300mm
Die Size(mm)
20.820.8
14.814.8
10.710.7
8.78.7
5.95.9
NDPW@0.2DD
68
175
450
1820
225
1700
4375
11250
45500
41
143
274
415
2030
Wafer
47
Table 5.2
Figure 5.3
Figure 13. The Wafer Size, Technology used and Gates realized.
In Table 5 for calculating the number of dies per wafer we use the following equation taken from connexions
module m33385, Part-9_Journey of IC Technology:
Figure 5.4
(
Figure 5.5
48
CHAPTER 5.
Figure 5.6
Figure 14. Sectoral Composition of $173.6b sales estimate by Altera in 2003 in terms of Consumption.
49
Figure 5.7
Figure 15. Sectoral Composition of $173.6b sales estimate by Altera in 2003 in terms of Function.
As shown in Figure 16 , Programmable Array Logic (PAL) is formed from a programmable AND and
xed OR array.
CHAPTER 5.
50
Figure 5.8
Figure 16.
Programmable Array Logic (PAL) formed from programmable AND Array and xed OR
Array.
We see in Figure 16 all intersections on decoder side that is on AND array side are shorted. By applying
10V Voltage pulse as we did in EEPROM, the NMOS can be disabled. The rest shorts are retained. Since
here we have full options for removing the shorts we say that AND Array is programmable.
On the encoder side we have no such option.
51
Figure 5.9
Figure 17. Programmable Logic Array. Both AND array and OR array are programmable.
As seen in the gure, on decoder as well as encoder side all intersections are shorted. User can remove the
short on the AND array side(decoder side) as well as on OR array side(encoder side) according to his Boolean
function requirement. Hence we say that AND array is programmable as well as OR array is programmable.
This PLA became the basis of SPLD, CPLD and FPGA.
References: Microelectronics by Millman & Grabel, McGraw Hill, 1988.
Principles of Digital Systems Design using VHDL, by Roth and John, CENGAGE Learning, 1998.
52
CHAPTER 5.
Chapter 6
DSD_Chapter 3_VHDL._introduction
and content
1
VHDL: An Introduction
Why VHDL
Characteristics
Basic Structure
Data Objects
Data Types
Combinational Logic Statements
Sequential Logic Statements
Concurrent Statements
Function
Procedure
Packages
Congurations
hardware language which has been standardized till date. It supports modeling and simulation of
digital
1 This
53
CHAPTER 6.
54
Executable specication
Validate spec in system context (Subcontract)
Functionality separated from implementation
Simulate early and fast (Manage complexity)
Explore design alternatives
Get feedback (Produce better designs)
Automatic synthesis and test generation (ATPG for ASICs)
Increase productivity (Shorten time-to-market)
Technology and tool independence (though FPGA features may be unexploited)
Portable design data (Protect investment)
Study of VHDL.
Its characteristics are:
1. Abstraction;
2. Modularity;
3. Concurrency;
4. Hierarchy.
ABSTRACTION.
When considering the application of VHDL to FPGA/ASIC design, VHDL can be used to describe
electronic hardware at many dierent levels of abstracton. There are three levels of abstraction:
1. Algorithm- these are unsynthesizables;
2. Register Transfer Level(RTL)-this is the input to synthesis;
3. Gate level- output from synthesis.
55
Figure 6.1
CHAPTER 6.
56
Figure 6.2
57
Figure 6.3
In
CHAPTER 6.
58
Figure 6.4
59
Figure 6.5
CHAPTER 6.
60
61
<=
this
example
two
types
of
components
are
dened:
HALF_ADDER
and
OR_GATE.
FULL_ADDER is implemented using two HALF_ADDERS. HALF_ADDER will be used as a component and later instantiated in a top entity of the program. Here we use our previous knowledge of building
FA from HA.
Example:
Architecture STRUCTURE of FULL_ADDER is
Component HALF_ADDER
CHAPTER 6.
62
Figure 6.6
By assigning the correct port map the components get instantiated into
Full_Adder.
DATA OBJECTS.
Data Object hold a value of specic type. There are three classes of data object namely:
63
1. Constants;
2. Variables;
3. Signals.
The class is specied by a reserved word that appears at the beginning of the declaration of that object.
CONSTANTS.
It is a Data Object which is initialized to a specic value when it is created and which cannot be
subsequently modied. Constant declarations are allowed in packages, entities, architectures, subprograms,
blocks and processes.
Constant YES: BOOLEAN :=True;
Constant CHAR7: BIT_VECTOR(4 downto 0) :=00111;
Constant MSB : INTEGER:= 5;
VARIABLES.
These data objects hold temporary data. They can be declared in a process or a subprogram.
Variable X, Y: std_logic;
Variable TEMP: std_logic_vector(8 downto 0);
Variable DELAY: INTEGER range 0 to 15:= 5;________initial value is 5
SIGNALS.
Signals connect design entities together and communicates changes in values between processes. They
can be interpreted as wires or buses in actual circuit. Signals can be declared in packages (global signals),
entities (entity global signals), architectures ( architecture global signals) and blocks.
Signal BEEP: std_logic :='0';
Signal TEMP: std_logic_vector(8 downto 0);
Signal COUNT: INTEGER range 0 to 100:=5;
DATA TYPES:
Data object must dened with a data type and the range of values it can assume.
Type declarations are allowed in package declaration sections, entity declaration sections, architecture
declaration sections, subprogram declaration sections and process declaration sections.
Data type include:
1. Enumeration types;
2. Integer types;
3. Predened VHDL data types;
4. Array Types;
5. Record types;
6. STD_LOGIC data type ;
7. Signed and unsigned data types;
8. Subtypes.
Enumeration Types
Integer types
VHDL Data types
Array Types
Record Types
Std_logic types
Signed and unsigned data types.
Subtypes.
LOGICAL OPERATORS
Logical operators are AND, OR,NAND, NOR, XOR and NOT accept operands of same type and same
length.
Type of OPERANDS can be BIT, BOOLEAN or ARRAY.
Example:
CHAPTER 6.
64
<=
A;(same as C<=(B<=A);)
. . .. . .
Process(. . ...)
Begin
65
Figure 6.7
CHAPTER 6.
66
Figure 6.8
<= 1;
<= 2;
<= A;
D := 3;
C
<=
D;
end process ;
67
Figure 6.9
0 - and
0 + are both 0 for a simulator. The interval, two delta (2D) is a virtual concept. A signal assignment is
executed after a delta delay however variable assignments are executed in zero time. The rst assignment
is a signal assignment, therefore A will be assigned 1 after a delta time. The second assignment is also a
signal assignment so A will be 2 after two delta time. Third assignment assigns signal B, the initial value
of A (the value at 0 - time) because delta time concept is virtual. So B takes 5 after a delta time. Fourth
assignment is a variable assignment, so it will be executed without delta delay. The last assignment is again
a signal assignment ; signal C takes the value of D after a delta time.
assigned to 3.
This is why signal assignments should be avoided in processes. If we dene signal A as a variable B takes
the value of 2 .
IF STATEMENTS.
Example:
Signal A,B, IN1, Y: std_logic;
Process (A,B)
Begin
If A= `1' AND B = `1' then
Y<= `0';
Elsif IN1= `1' then
Y<= `1';
Else Y
<=
`0';
End if;
End process;
CASE STATEMENTS.
This selects one of a number of alternative sequence of statements. The chosen alternative is dened by
the value of an expression.
CHAPTER 6.
68
Example:
Signal S1: INTEGER range 0 to 7;
Signal I1, I2, I3 : BIT;
Process (S1, I1,I2,I3)
Begin
Case S1 is
When 0|2 =>
OU<= `0';
When 1 =>
OU<= I1;
When 3 to 5 =>
OU<=I2;
When others =>
OU<= I3;
End case;
End process;
LOOP STATEMENTS.
A repeated process is put into LOOP STATEMENT.
There are two loops:
FOR Loop and WHILE Loop.
If LOOP not used and repetitive statement is used then we use WAIT and EXIT STATEMENTS.
Example of two nested loops without iteration.
Count_down: process
Variable min, sec : integer range 0 to 60;
Begin
L1: loop
L2: loop
Exit L2 when (sec=0);
Wait until CLK'event and CLK = `1';
Sec := sec-1; every decrement takes place at the leading edge of the CLOCK.
End loop L2;
ExitL1 when (min = 0);
Min:= min 1;
Sec := 60;
End loop L1;
End process count_down;
FOR loop statements.
This iterates over a number of values. The loop index is integer value by default.
It can be reassigned a value within the loop.
Example:
For i in 1 to 10 loop
A(i) := i*I;
End loop;
For I in X downto Y loop
A(I) := i*i;
End loop;
WHILE Loop Statements.
A WHILE LOOP executes the loop body by rst evaluating the condition. If the condition is true the
loop is executed.
Example:
Process
69
Variable a, b, c, d : integer;
Begin
. . .. . .. . .. . .. . .. . .. . .
While ((a+b)>(c+d))
loop
A :=a-1;
C:=c+b;
B := b d;
End loop;
. . .. . .. . .. . ...
End process;
NULL STATEMENTS.
This statement is used to explicitly state that no action is to be performed when a condition is true.
Example:
Variable A,B:INTEGER range 0 to 31;
Case A is
When 0 to 12 =>
B := A;
When others =>
Null;
End case;
Assertion Statements.
Next Statement
Exit Statement.
Wait Statement.
Procedure Statement.
Concurrent Statement.
Process Statement.
A process statement is composed of sequential statements but processes themselves are concurrent.
The process statement must have either a sensitivity list or a wait statement or both.
Example.
Architecture A2 of example is
Signal i1, i2, i3 , i4, and_out, or_out : bit;
Begin
Pr1: process(i1, i2, i3, i4)
Begin
And_out<= i1 and i2 and i3 and i4;
End process pr1;
Pr2: process(i1,i2,i3,i4)
Begin
Or_out<= i1 or i2 or i3 or i4;
End process pr2;
End A2;
Concurrent Signal assignments.
Conditional Signal Assignments.
Block Statements.
Block Statement.
Example: Block B1-1 is nested within block B1. Both B1 and B1-1 declare a signal named S. The signal
S used in Block B1-1 will be the one declared within B1-1 while S is used in block B2 is the one declared in
B1.
Architecture BHV of example is
Signal out1: integer;
CHAPTER 6.
70
71
Process
Variable TOP,BOTTOM,ODD,dummy:bit;
Varable y: bit_vector (15 downto 0);
Begin
.
.
Parity(y(15 downto 8), TOP, dummy);
Parity(y(7 downto 0), BOTTOM, dummy);
ODD:= TOP xor BOTTOM;
End process;
End BHV;
PACKAGES.
The package body species the actual behavior of the package. It has the same name as the declaration.
Example>
Library IEEE;
Use IEEE.NUMERIC_BIT.all;
Package PKG is
Subtype MONTHY_TYPE is integer range 0 to 12;
Subtype DAY_TYPE is integer range 0 to 31;
Subtype BCD4_Type is unsigned (3 downto 0);
Subtype BCD5_Type is unsigned ( 4 downto 0);
Constant BCD5_1: BCD5_TYPE := B*0_0001;
Constant BCD5_7: BCD5_TYPE := B*0_0111;
Function BCD_INC(L: in BCD4_TYPE)return BCD5_TYPE;
End PKG;
Package body PKG is
Function BCD_INC(L: in BCD4_TYPE)return BCD5_TYPE is
Variable V,V1,V2: BCD5_TYPE;
Begin
V1:= L+BCD5_1;
V2:=L+BCD5_7;
Case V2(4) is
When `0' => V:=V1;
When `1' => V:=V2;
End case;
Return (V);
End BCD_INC;
End PKG;
GENERATE STATEMENT.
The generate statement is a concurrent statement that has to be dened in an architecture. It is used to
describe replicated structures. The syntax is :
instantiation_label : generation_scheme
generate
{concurrent_statement}
Its value may be read but cannot be assigned or passed outside a generate
statement.
Example:
Architecture IMP of FULL_ADDER4 is
CHAPTER 6.
72
<=
TMP(4);
End IMP;
Figure 6.10
forinstantiation_list : component_name
useentitylibrary_name . entity_name [ (architecture_name )] ;
73
74
CHAPTER 6.
Chapter 7
1 This
75
CHAPTER 7.
76
Other options are General Purpose, Automotive, Military, Hi-reliability, Radiation Hardened.
Family SPARTAN2 (FPGA)
Other options are QPro Virtex Hi-Rel, QPro Virtex4Hi-Rel,Q-Pro Virtex4 Rad Tolerant, QPro VirtexE
Military, Spartan3A DSP.
Device : XC2S15_____Xilinx component, Spartan2,15k gate count.
Other options are XC2S30,XC2S50,XC2S100,XC2S150.
Package: TQ144_______no of pins 144.
Other options are CS144, VQ100.
Speed: -6
Other options are -5, -5Q
Top Level Source Type: HDL.
Synthesis Tool XST(VHDL/Verilog)
Simulator: ModelSim XE VHDL.
Other options of Simulator are ModelSim XE Verilog,NC Sim VHDL, NC Sim Verilog, NC Sim Mixed,
VCS MX VHDL, VCS MX Verilog, VCS MX Mixed, VCS MXi Verilog.
At the bottom three messages displayed:
Enable Enhanced Design Summary
Enable Message Filtering
This imples that Enable Enhanced Design Summary is enabled and Enable Message Filtering+ Display
Incremental Message are disabled.
Click
NEXT.
New Source
Following options will come_____IPSchematic,State Diagram, Test Bench Waveform, User Document,
Verilog Module, Verilog Test Fixture, VHDL Module, VHDL Package, VHDL Test Bench.
Creating a new source and adding to the Project is optional. Existing source can be added on the next
page.
Click
NEXT.
NEXT.
Finish.
Following icons will display on left margin.
[U+2302]
ANDGate1
77
NEXT is highlighted
NEXT
Click_______________
Dene Module
Entity Name____________ANDGate1
Architecture Name_______Behavioral
Port Name_____________Direction
A____________________in
B____________________in
Y____________________out
Click _____________
NEXT
FINISH
-[U+250C][U+2510][U+2514][U+2518][U+250C][U+2510]_ ANDGate1.Behavioral
This is right clickedSet as Top ModuleClick
_____________________ANDGate1
[U+2514][U+2518]will
Behavioral
will
be
selected
as
Top
Module.Upper
appear green.
On the right, Note Pad and initial part of VHDL Program will appear.
Following will be the Hardware Description of the Entity ANDGate1
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity ANDGate1 is
Port(A:in std_logic;
____B:in std_logic;
____Y:out std_logic);
End ANDGate1;
Architecture Behavioral of ANDGate1 is
____Begin
____Y<='1' when A= `1' and B= `1' else `0';
End behavioral;
Once the codes are written we will carry out the syntax check.
Click the icon
[U+250C][U+2510][U+2514][U+2518][U+250C][U+2510]_
ANDGate1.Behavioral
CHAPTER 7.
78
[U+2592]
View RTL (Register Transfer Level) Schematic, we get to see the interface connections
[U+2592]
View Technology Schematic, we get to see the internal architecture of the entity.
Now we can carry out the FUNCTIONAL VALIDATION of the given source by writing its TEST
BENCH.
NEXT is highlighted
NEXT
NEXT
Click_______________
New Source Wizard-Summary.
Project Navigator will create a new skeleton source with the following specications:
Add to Project: Yes
Source Directory: C:\Documents and Settings\BKS\ANDGate1
Source Type:VHDL TestBench.
Source Name: TbANDGate1.vhd
Association: ANDGate1
Click ________________
FINISH
On the right hand side in the Note-Pad we write the test bench program.
Library IEEE
Use ieee.std_logic_1164.all;
79
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity TbANDGate1 is
End TbANDGate1;
Architecture Behavioral of ANDGate1 is
- - - -component declaration for the unit under test(uut).
Component ANDGate1
____Port(a:in std_logic;
________b:in std_logic;
________y:out std_logic);
End component;
- - - -inputs.
Signal a:std_logic:= `0';
Signal b:std_logic:= `0';
- - - outputs.
Signal y:std_logic;
Begin
- - - - -instantiate(or incorporate) the unit under test(UUT);
uut:ANDGate1 Port Map
(a => a,
b => b,
y => y,);- - - - - => means transpose or corresponds;
- - - - - no clocks detected in port list. Replace<clocks> below with appropriate name.
- - - - -constant<clock>_period:= 1 ns;
- - - - -<clock>_process:process
- - - - -begin
- - - - -<clock>
<= `0' ;
<clock>_period/2;
-<clock> <= `1' ;
-wait for <clock>_period/2;
- - - - -wait for
- - - - - - -
- - - - -end process;
- - - - stimulus process
________stim_proc:process
________begin
____________wait for 10 ns;
____________a<= `1';
____________b<= `1';
____________wait for 10 ns;
____________a<= `1';
____________b<= `0';
____________wait for 10 ns;
____________a<= `1';
____________b<= `1';
____________wait for 10 ns;
____________a<= `1';
____________b<= `0';
- - - - - - - - - - -insert stimulus here
_________wait;
_________end process;
End;
Change Implementation to Behavioral Simulation.
CHAPTER 7.
80
Figure 7.1
81
Figure 7.2
Figure 7.3
CHAPTER 7.
82
Logic_system1
#xc2s15-6tq144___Right Click and add new source.
[U+2302]
We need to dene three gates: AND_Gate, XOR_Gate and OR_Gate.Each gate will be dened, selected
as TOP MODULE and synthesized. Once synthesis is complete then we will move to the next new source.
Finally we will synthesize LogicSystem1.
MODULE. Once the synthesis of LogicSystem1 is successful we will validate it by making its Test Bench.
After dening, we instantiate (or incorporate) these three gates to Logic System1.
Add a new source and name it ANDgate
First we dene AND_Gate:
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity AND_Gate is
Port(A:in std_logic;
____B:in std_logic;
____Y:out std_logic);
End AND_Gate;
Architecture Behavioral of ANDGate1 is
Begin
Y<= A and B;- - - - data ow design method
End behavioral;
Select ANDgate as TOP MODULE and do the syntax check here itself.
Second we dene XOR_Gate by right clicking
#xc2s15-6tq144
XOR_Gate.
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity XOR_Gate is
Port(A:in std_logic;
____B:in std_logic;
____Y:out std_logic);
End XOR_Gate;
Architecture Behavioral of XOR_Gate is
Begin
Y<= A xor B;- - - - data ow design method
End behavioral;
Here XORgate is selected as TOP MODULE and syntax check is done.Once synthesis is successful then
only proceed forward.
Third we dene OR_Gate by right clicking
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity OR_Gate is
Port(A:in std_logic;
____B:in std_logic;
____Y:out std_logic);
End OR_Gate;
Architecture Behavioral of OR_Gate is
83
Begin
Y<= A or B;- - - - data ow design method
End behavioral;
Now we implement Logic_System1 (Figure 3) by interconnecting these three components. But rst these
three Gates will have to be declared.
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity logic_system is
______Port(A: in std_logic;
__________B: in std_logic;
__________C: in std_logic;
__________D: in std_logic;
__________Y: out std_logic);- - - -interface connections are declared
Architecture arch_logic_system1 of logic_system1 is
______Signal P:std_logic;
______Signal Q:std_logic;
______Component And_gate is- - - - -declaration of And_Gate;
______________Port(A,B: in std_logic;
____________________Y: out std_logic
______________________);
______End component;
______Component Or_gate is
____________Port(A,B: in std_logic;
__________________Y: out std_logic
___________________);
______End component;
______Component XOR_gate is- - - -declaration of XOR_Gate
____________Port(A,B: in std_logic;
___________________Y: out std_logic
___________________);
_______End component;
Begin
_______U1: And_gate port map(A,B,P);non-named association.
-Port map(A[U+F0F3] A, B[U+F0F3]B, P[U+F0F3] Y);-named association.
_______U2:XOR_gate port map(C, D, Q);
_______U3:Or_gate port map (P,Q, Y);
End arch_logic_sysytem1;
LogicSystem1 is set as TOP MODULE and syntax check is done until SYNTHESIS is successful. Then
we add a new source TbLogicSystem1. LogicSystem1 is our UUT. Test bench is associated with UUT and
ModelSim is carried out. Check if you get the correct output for a given input.Once validated we can send
the mask diagrams to the Foundry.
Implementation of Combinatorial Logic System2.
84
CHAPTER 7.
Figure 7.4
Figure 7.5
85
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity logic_system2 is
Port(A: in std_logic;
____B: in std_logic;
____C: in std_logic;
____D: in std_logic;
____E: in std_logic;
____F: in std_logic;
____G: in std_logic;
____Y:out std_logic);
Architecture Arch_logic_system2 of logic_system2 is
______Signal P: std_logic;
______Signal Q: std_logic;
______Signal R: std_logic;
______Signal S: std_logic;
______Component And_gate is
____________Port(A,B: in std_logic;
__________________Y:out std_logic);
____________End component:
______Component Or_gate is
____________Port(A,B: in std_logic;
__________________Y: out std_logic);
____________End component;
______Component NAND_gate is
____________Port(A, B, C:in std_logic;
____________________Y: out std_logic);
____________End component;
______Component NAND_gate is
____________Port(A, B:in std_logic;
__________________Y: out std_logic);
____________End component;
_______Component XNOR_gate is
____________Port(A, B, C:in std_logic;
____________________Y: out std_logic);
____________End component;
_______Begin
____________U1: And_gate port map(A,B,P);
____________U2: Nand_gate port map (C,D,E,Q);
____________U3: XNOR_gate port map (F, G, R);
____________U4:NAND_gate port map (P, Q, S);
____________U5: OR _gate port map (S, R, Y);
______End arch_logic_system2;
For functional validation, the interconnected components will have to be dened,their behavioral architecture will have to be dened
VHDL codes for AND gate.
CHAPTER 7.
86
Figure 7.6
<=
`0';
__________end if;
__________End process;
End arch_AND_gate;
Behavioral Architecture of OR gate using `When' `Else'
87
Figure 7.7
Figure 7.8
CHAPTER 7.
88
Entity XNOR_gate is
_______Port (A: in std_logic;
____________B: in std_logic;
____________Y: out std_logic);
End XNOR_gate;
Architecture behavioral of XNOR_gate is
Begin
______Process(A, B)
______Begin
______If A = B then Y<= `1';
______else Y<= `0';Equality gate or even parity gate
______end if;
______end process;
End behavioral;
Behavioral Architecture of XOR gate using `When' `Else'
Figure 7.9
89
Figure 7.10
<=
`1';
_________end if;
_________end process;
End behavioral;
90
CHAPTER 7.
Chapter 8
This imples that Enable Enhanced Design Summary is enabled and Enable Message Filtering+ Display
Incremental Message are disabled.
Click
1 This
NEXT.
91
CHAPTER 8.
92
New Source
Following options will come_____IPSchematic,State Diagram, Test Bench Waveform, User Document,
Verilog Module, Verilog Test Fixture, VHDL Module, VHDL Package, VHDL Test Bench.
Creating a new source and adding to the Project is optional. Existing source can be added on the next
page.
Click
NEXT.
NEXT.
Finish.
[U+2302]
ANDGate1
NEXT is highlighted
NEXT
Click_______________
Dene Module
Entity Name____________ANDGate1
Architecture Name_______Behavioral
Port Name_____________Direction
A____________________in
B____________________in
Y____________________out
Click _____________
NEXT
93
A_______________Pin________in
B_______________Pin________in
Y_______________Pin________in
Click ________________
FINISH
-[U+250C][U+2510][U+2514][U+2518][U+250C][U+2510]_ ANDGate1.Behavioral
This is right clickedSet as Top ModuleClick
ANDGate1 Behavioral will be selected as Top Module.Upper
[U+2514][U+2518]will
appear green.
On the right Note Pad and initial part of VHDL Program will appear.
Following will be the Hardware Description of the Entity ANDGate1
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity ANDGate1 is
__________Port(A:in std_logic;
_______________B:in std_logic;
_______________Y:out std_logic);
End ANDGate1;
Architecture Behavioral of ANDGate1 is
Begin
Y<='1' when A= `1' and B= `1' else `0';
End behavioral;
Once the codes are written we will carry out the syntax check.
Click the icon
[U+250C][U+2510][U+2514][U+2518][U+250C][U+2510]_
ANDGate1.Behavioral
CHAPTER 8.
94
c. Timing Report.
If we click
[U+2592]
View RTL (Register Transfer Level) Schematic, we get to see the interface connections
[U+2592]
View Technology Schematic, we get to see the internal architecture of the entity.
Now we can carry out the FUNCTIONAL VALIDATION of the given source by writing its TEST
BENCH.
Right Click xc2s-6tq144 and add a new source
NEXT
FINISH
______________________[U+250C][U+2510][U+2514][U+2518][U+250C][U+2510]TbANDGate1Behavioral appears.
Click__________________
TbANDGate1-Behavioral
95
Figure 8.1
CHAPTER 8.
96
Figure 8.2
97
Figure 8.3
CHAPTER 8.
98
<=
y;
__________________End if;
__________________End process;
End behavioral;
DESIGN OF MULTIPLEXER.
Caution:
99
Figure 8.4
CHAPTER 8.
100
Figure 8.5
S1
S0
D3
D2
D1
D0
Dec
Table 8.1
101
<=
d(0);
_________elsif (s = 01)
_________then y
<=
d(1);
__________elsif (s = 10)
<= d(2);
<= d(3);
__________then y
__________else y
________end if;
end process;
end behavioral;
CHAPTER 8.
102
Figure 8.6
103
Component Or_gate is
Port(A,B : in std_logic;
______Y : out std_logic);
End component;
U1: inverter port map (S, T);
U2: and_gate port map (T,D1, Q);
U3:and_gate port map (S,D2,R);
U4: or_gate port map (Q,R, Y);
End arch_2:1MUX;
Behavioral description of 2:1MUX.
Library IEEE
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity 2:1MUX is
Port (D1: in std_logic;
_____D2: in std_logic;
_____S: in std_logic;
_____Y: out std_logic);
End 2:1MUX;
Architecture Behavioral of 2:1MUX is
Begin
Process (D1, D2, S)
Begin
_____If (S = `0') then y<= D1;
____Else
____Y<= D2;
____End if;
End process;
End Behavioral;
As we see Structural Hardware Description is lengthier than Behavioral Hardware Description.
XC95. . ... series is CPLD.
XC3001-FPGA
4000-FPGA
Build 8:1MUX using 2:1MUX.
104
CHAPTER 8.
Figure 8.7
Chapter 9
Threebit_updowncounter
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
- Uncomment the following library declaration if instantiating
- any Xilinx primitives in this code.
library UNISIM;
use UNISIM.VComponents.all;
entity threebit_updowncounter is
___Port ( clk : in STD_LOGIC;
______reset : in STD_LOGIC;
______count_en : in STD_LOGIC;
______up : in STD_LOGIC;
______sum : out STD_LOGIC_VECTOR(2 downto 0);
______cout : out STD_LOGIC);
end threebit_updowncounter;
architecture Behavioral of threebit_updowncounter is
signal count:std_logic_vector(2 downto 0);
begin
______process(clk,reset)
______begin
____________if reset = '0' then
____________count<=(others=>'0');
____________elsif clk'event and clk = '1' then
____________if count_en = '1' then
____________case up is
__________________when '1' =>count<=count+1;
__________________when others =>count<=count-1;
____________end case;
____________end if;
____________end if;
1 This
105
CHAPTER 9.
106
______end process;
______sum<=count;
______cout<= '1' when count_en = '1' and
______((up= '1' and count = 7) or (up= '0'and count= 0))
______else '0';
end Behavioral;
Threebit_updowncounter_TEST_BENCH
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY Tb_threebit_updowncounter IS
END Tb_threebit_updowncounter;
ARCHITECTURE behavior OF Tb_threebit_updowncounter IS
Component Declaration for the Unit Under Test (UUT)
COMPONENT threebit_updowncounter
PORT(
___clk : IN std_logic;
___reset : IN std_logic;
___count_en : IN std_logic;
___up : IN std_logic;
___sum : OUT std_logic_vector(2 downto 0);
___cout : OUT std_logic
);
END COMPONENT;
Inputs
signal clk : std_logic := '0';
signal reset : std_logic := '0';
signal count_en : std_logic := '0';
signal up : std_logic := '0';
Outputs
signal sum : std_logic_vector(2 downto 0);
signal cout : std_logic;
Clock period denitions
constant clk_period : time := 100 ns;
BEGIN
Instantiate the Unit Under Test (UUT)
uut: threebit_updowncounter PORT MAP (
____clk => clk,
____reset => reset,
____count_en => count_en,
____up => up,
____sum => sum,
____cout => cout
);
Clock process denitions
clk_process :process
begin
____________clk
<=
'0';
<=
'1';
107
Figure 9.1
st line_____clk
nd line_____reset
2
1
rd line______count_en
th line______up
4
3
th line_______sum
th line_______[2]___Q
6
5
C
th line_______[1]___ Q
B
th line_______[0]___ Q
8
A
7
A time span of 1700ns is being covered. Time period of the clock is 100 ns.
For 700 ns it is counting up and next 700 ns it is counting down.
Threebit_Counter
library IEEE;
CHAPTER 9.
108
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
- Uncomment the following library declaration if instantiating
- any Xilinx primitives in this code.
library UNISIM;
use UNISIM.VComponents.all;
entity threebitcounter is
___Port ( clk : in STD_LOGIC;
______reset : in STD_LOGIC;
______count_en : in STD_LOGIC;
______sum : out STD_LOGIC_VECTOR(2 downto 0);
______cout : out STD_LOGIC);
end threebitcounter;
architecture Behavioral of threebitcounter is
signal count:std_logic_vector(2 downto 0);
begin
______process(clk,reset)
______begin
______if reset = '0' then
______count<=(others=> '0');
______elsif clk'event and clk = '1' then
______if count_en = '1' then
______count<= count+1;
______end if;
______end if;
______end process;
______sum<=count;
______cout<= '1' when count=7 and count_en= '1' else '0';
end Behavioral;
Threebit_counter_TEST_BENCH
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY Tb_threebitcounter2 IS
END Tb_threebitcounter2;
ARCHITECTURE behavior OF Tb_threebitcounter2 IS
Component Declaration for the Unit Under Test (UUT)
COMPONENT threebitcounter
PORT(
___clk : IN std_logic;
___reset : IN std_logic;
___count_en : IN std_logic;
___sum : OUT std_logic_vector(2 downto 0);
___cout : OUT std_logic
);
END COMPONENT;
Inputs
signal clk : std_logic := '0';
signal reset : std_logic := '0';
109
<=
'0';
<=
'1';
CHAPTER 9.
110
Figure 9.2
First line_________Clock
Second Line_______Reset
Third Line_________Count_en
Fourth Line________SUM
________________Most Signicant Bit___(2)
________________Less Signicant Bit____(1)
________________Least Signicant Bit____(0)
Eigth Line__________Cout.
Second Version of 3_bit_counter
entity threebitcounter_two is
__Port ( clk : in STD_LOGIC;
______reset : in STD_LOGIC;
______count_en : in STD_LOGIC;
______sum : out STD_LOGIC_VECTOR(2 downto 0);
______cout : out STD_LOGIC);
end threebitcounter_two;
architecture Behavioral of threebitcounter_two is
signal count:std_logic_vector(2 downto 0);
begin
________________process(clk,reset)
________________begin
________________if reset= '0' then
________________count<=(others=> '0');
-count is null
________________elsif clk'event and clk = '1'then
________________if count_en = '1' then
________________if count/= 7 then
________________count<=count+1;
________________else
__________________count<=(others=> '0');
__________________end if;
________________end if;
111
________________end if;
________________end process;
________________sum<=count;
________________cout<= '1' when count=7 and count_en= '1'
________________else '0';
end Behavioral;
Threebit_counter_TEST_BENCH
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY Tb_threebitcounter_two IS
END Tb_threebitcounter_two;
ARCHITECTURE behavior OF Tb_threebitcounter_two IS
Component Declaration for the Unit Under Test (UUT)
COMPONENT threebitcounter_two
PORT(
__clk : IN std_logic;
__reset : IN std_logic;
__count_en : IN std_logic;
__sum : OUT std_logic_vector(2 downto 0);
__cout : OUT std_logic
);
END COMPONENT;
Inputs
signal clk : std_logic := '0';
signal reset : std_logic := '0';
signal count_en : std_logic := '0';
Outputs
signal sum : std_logic_vector(2 downto 0);
signal cout : std_logic;
Clock period denitions
constant clk_period : time := 100 ns;
BEGIN
Instantiate the Unit Under Test (UUT)
uut: threebitcounter_two PORT MAP (
___clk => clk,
___reset => reset,
___count_en => count_en,
___sum => sum,
___cout => cout
);
Clock process denitions
clk_process :process
begin
__________________clk
<=
'0';
<=
'1';
CHAPTER 9.
112
stim_proc: process
begin
hold reset state for 100 ns.
wait for 100 ns;
________________________reset<= '1';
________________________wait for 100 ns;
insert stimulus here
________________________count_en<= '1';
________________________wait for 1600 ns;
________________________count_en<= '0';
________________________wait;
end process;
END;
Figure 9.3
First line_________Clock
Second Line_______Reset
Third Line_________Count_en
Fourth Line________SUM
________________Most Signicant Bit___(2)
________________Less Signicant Bit____(1)
________________Least Signicant Bit____(0)
Eigth Line__________Cout
During count_en
<=
`1' 1600 ns elapse hence counter counts up two times and resets two times. Two
times counter reaches 111 and generates cout = `1'.It gets a chance to count the third time. Just then
count_en
<=
113
use UNISIM.VComponents.all;
entity mux4_1 is
___Port ( s : in STD_LOGIC_VECTOR(1 downto 0);
_______d : in STD_LOGIC_VECTOR(3 downto 0);
_______y : out STD_LOGIC);
end mux4_1;
architecture Behavioral of mux4_1 is
begin
______y<= d(0) when s = "00" else
______d(1) when s = "01" else
______d(2) when s = "10" else
______d(3);
end Behavioral;
MUX2_1
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
- Uncomment the following library declaration if instantiating
- any Xilinx primitives in this code.
library UNISIM;
use UNISIM.VComponents.all;
entity mux2_1 is
Port ( d1 : in STD_LOGIC;
d2 : in STD_LOGIC;
s : in STD_LOGIC;
y : out STD_LOGIC);
end mux2_1;
architecture Behavioral of mux2_1 is
begin
process(d1,d2,s)
begin
if (s= '0')then y<=d1;
else
y<=d2;
end if;
end process;
end Behavioral;
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY Tb_mux2_1 IS
END Tb_mux2_1;
ARCHITECTURE behavior OF Tb_mux2_1 IS
Component Declaration for the Unit Under Test (UUT)
COMPONENT mux2_1
PORT(
____d1 : IN std_logic;
____d2 : IN std_logic;
____s : IN std_logic;
CHAPTER 9.
114
<clock>
below with
<clock>_period
:= 1ns;
<clock>_process
:process
begin
wait for
end process;
Stimulus process
stim_proc: process
begin
hold reset state for 100ms.
wait for 100 ns;
wait for
<clock>_period*10;
115
Figure 9.4
CHAPTER 9.
116
When s = `1', y = d2 which carries a periodic waveform of Period 40 ns. Hence for the remaining 50 ns,
y carries a periodic waveform of Period 40 ns.
This is called Time Divison Multiplexing (TDM) which is used in Digital Communication for passing
million telephonic conversations on a single optical ber.
For remaining 30 ns, d1 = d2 = s = `0'. Hence output is ZERO.
MUX2_1version4
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY Tb_mux2_1_version4 IS
END Tb_mux2_1_version4;
ARCHITECTURE behavior OF Tb_mux2_1_version4 IS
Component Declaration for the Unit Under Test (UUT)
COMPONENT mux2_1_version4
PORT(
___s : IN std_logic;
___d : IN std_logic_vector(1 downto 0);
___y : OUT std_logic
);
END COMPONENT;
Inputs
signal s : std_logic := '0';
signal d : std_logic_vector(1 downto 0) := (others => '0');
Outputs
signal y : std_logic;
BEGIN
Instantiate the Unit Under Test (UUT)
uut: mux2_1_version4 PORT MAP (
____s => s,
____d => d,
____y => y
____);
No clocks detected in port list. Replace
<clock>
below with
<clock>_period
:= 1ns;
<clock>_process
:process
begin
wait for
end process;
Stimulus process
stim_proc: process
begin
hold reset state for 100ms.
wait for 100 ns;
wait for
<clock>_period*10;
117
____________d<= "00";
____________s<= '0';
____________wait for 10 ns;
____________d<="01";
____________s<= '0';
____________wait for 10 ns;
____________d<="10" ;
____________s<= '0';
____________wait for 10 ns;
____________d<="11";
____________s<= '0';
____________wait for 10 ns;
____________d<="00";
____________s<= '0';
____________wait for 10 ns;
____________d<="01";
____________s<= '1';
____________wait for 10 ns;
____________d<="10";
____________s<= '1';
____________wait for 10 ns;
____________d<="11";
____________s<= '1';
____________wait for 10 ns;
____________d<="00";
____________s<= '1';
____________wait for 10 ns;
____________d<="01" ;
____________s<= '1';
____________wait for 10 ns;
____________d<= "00";
____________s<= '0';
_______wait;
end process;
END;
Figure 9.5
CHAPTER 9.
118
When s = `0', y = d(0) which carries a periodic waveform of Period 20 ns. Hence for this 50 ns, y carries
a periodic waveform of Period 20 ns.
When s = `1', y = d(1) which carries a periodic waveform of Period 40 ns. Hence for the remaining 50
ns, y carries a periodic waveform of Period 40 ns.
This is called Time Divison Multiplexing (TDM) which is used in Digital Communication for passing
million telephonic conversations on a single optical ber.
For remaining 25 ns, d = 00; s = `0'. Hence output is ZERO.
MUX4_1
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.All;
USE ieee.numeric_std.ALL;
ENTITY Tb_mux4_1 IS
END Tb_mux4_1;
ARCHITECTURE behavior OF Tb_mux4_1 IS
Component Declaration for the Unit Under Test (UUT)
COMPONENT mux4_1
PORT(
___s : IN std_logic_vector(1 downto 0);
___d : IN std_logic_vector(3 downto 0);
___y : OUT std_logic
____);
END COMPONENT;
Inputs
signal s : std_logic_vector(1 downto 0) := (others => '0');
signal d : std_logic_vector(3 downto 0) := (others => '0');
Outputs
signal y : std_logic;
BEGIN
Instantiate the Unit Under Test (UUT)
uut: mux4_1 PORT MAP (
____s => s,
____d => d,
____y => y
_____);
No clocks detected in port list. Replace
<clock>
below with
<clock>_period
:= 100 ns;
<clock>_process
:process
begin
wait for
end process;
Stimulus process
stim_proc: process
begin
hold reset state for 100 ns.
wait for 100 ns;
119
Figure 9.6
120
CHAPTER 9.
Chapter 10
Berkeley, was heading this Project. The aim of this Project was to develop the nuclear ssion bomb more
commonly known as Atom Bomb. [Two atom bombs named `Little Boy' and `Fat Man' were subsequently
dropped on Hiroshima and Naqasaki, Japan, respectively on 6
ten Project necessitated the development of Stored Program Computer called EDVAC(Electronic Discrete
Variable Automatic Computer).
John von Neumann became involved with Manhatten Project for the sake of development of Stored
Program Digital Computer. Von Neumann was a Hungarian American Mathematician who was considered
to be the last of the great mathematicians and who subsequently won the title of Father of Modern Digital
Computer. He submitted First Draft of a Report on the EDVAC
Universal Turing Machine and this was known as von Neumann Architecture. Stored-program computers
were an advancement over the program-controlled computers of the 1940s, such as the Colossus
3 and the
4
ENIAC , which were programmed by setting switches and inserting patch leads to route data and to control
signals between various functional units. ENIAC used to take 3 weeks to write a new program and get it
run.
121
CHAPTER 10.
122
Figure 10.1
Figure
1,
the
proposed
architecture
is
shown.
In
this
new
architecture
Memory
and
CPU(ALU+Control Unit) are separated. Memory stores both data and instructions. This works sequentialy. Through Data Buses the data is sent to and fro between the memory and CPU. CPU works much
faster than the availability of data. This is because CPU processing speed is being scaled up with each new
generation of technology but the rise in bus speed is not commensurate. Hence we face a limited throughput
between memory and CPU as compared to the size of the memory. Because of the limited throughput CPU
is continuously waiting for data after completing its number crunching. This considerably slows down the
Instructions per second execution.
and it can be removed by matching the bus speed with CPU processing speed. Several methods have been
suggested to overcome this problem.
In the initial phase three standard methods were suggested to overcome von Neumann bottle neck:
i. A cache memory between the main memory and CPU. This cache memory stores the current data and
makes it readily available to CPU. For rapid exchange of Data between cache and CPU, cache is made
of SRAM whereas the main memory is DRAM. SRAM is made of BJT and has a much faster access
time as compared to that of DRAM which is made of CMOS.
ii. Providing separate Caches and separate access paths for data and instructions.
This is known as
Harvard Architecture.
iii. Using Branch predictor and logic.
Recently in contrast to sequential Architecture/von Neumann Architecture/Scalar Architecture, parallel
architecture/vector architecture has been introduced to overcome the problem of von Neumann architecture.
The notable vector architectures are:
a. Systolic Architecture.
b. Data-ow Architecture.
c. Pipeline Architecture.
123
This has eased the bottleneck but not eradicated the problem. Construction of `State Machines' is a step in
that direction. Here it may be mentioned in passing that all these architectures are based on `Algorithmic
Programming' which use `Boolean Logic'.
on `Rules of Thumb' and which uses `Predicate Logic'. The Fifth Generation Computers more commonly
known as Articial Intelligence Machines are based on heuristic programming and use `LISP' and `PROLOG'
programming languages. These have already come in the market and are being used as Knowledge Expert
Systems in Health, Care and Delivery.
To appreciate the superiority of State Machines over the present Desk Top Computers we must look at
the following VHDL example which can be run on both State Machine and CPU:
< 7 then
<= alarm;
___Out_a <= `0';
___Out_b <= `0';
___Out_analog <= a+b;
If a
>
37 and c
___State
Else
___State
<=
running;
End if;
This program denes two states: `ALARM' state and `RUN' state. When condition 1 namely `a
and c
<
7' is fullled the machine is put in Alarm state and if condition 2 namely `a
<
37 and c
>
>
37
7' is
CHAPTER 10.
124
Figure 10.2
125
Figure 10.3
Mealy Machine:
In a Mealy Machine, the outputs are a function of the present state and the value of the current inputs
as shown in Figure 3.
Accordingly the outputs of a Mealy Machine can change asynchronously in response to any change in
the inputs. The output need not change at a Clock Pulse.
CHAPTER 10.
126
Figure 10.4
Moore Machine:
In Moore Machine outputs depend only on the present state as shown in Figure 4.
Combinational logic block 1 maps the inputs and the current state into the necessary ip-op inputs.
The ip-ops act as memory elements. The outputs of the memory elements are the present state code
and impressed on the second combinational logic circuit.
The second combinational logic circuit generates the outputs corresponding to the present state.
The outputs change synchronously with the state transition triggered by the active clock edge applied
to the memory elements.
5.3. Design and Construction of Finite State Machine by Mealy Design Approach and Moore Design Approach.
The customer wants a Motor Rotation Sensor. The sensor should indicate if the Motor is spinning in
Anti-Clockwise (POSITIVE) or Clockwise (NEGATIVE) direction.
127
Figure 10.5
5.4. Comparison of Mealy and Moore Machines while designing `10' pattern detector.
CHAPTER 10.
128
Figure 10.6
Figure 6. The state diagrams of Mealy and Moore Machines designed for detecting `10' pattern.
Problem 1 : Our customer has asked for `10' Sequence Detector . This should give an output HIGH only
when `10' sequence is detected.
We will design a FSM(Finite State Machine) which checks for `10' pattern and when such a pattern is
detected it gives an output HIGH otherwise output is maintained LOW.
We can take both Mealy Machine approach as well as Moore Machine approach.
First let us consider Mealy Machine State Diagram given on the left of Figure 6.
Mealy Machine State Diagram lists the input/associated_output on the state transition arcs.
There are two distinct states: `initial'state and `1' state.
Let us consider Moore Machine State Diagram given on right hand side of Figure 6.
A Moore Machine produces an unique output for every state irrespective of inputs.
Hence
129
Accordingly the state diagram of the Moore Machine associates the output with its respective state in
the form state-notation/output-value.
State transition arrows of Moore Machine are labeled with the input value that triggers the transition.
As seen in the state diagram Figure 6, there are three distinct states: `initial' , `1' and `11'.
In the state `initial', output is LOW. If the rst input is 0 , machine remains in `initial' state.
If the rst input is 1 then this input triggers the transition to the second state `1' and since the desired
pattern is not achieved therefore output remains LOW but we have moved one step in the direction of
desired detection.
If the second input is 1, we remain in state `1' and output remains LOW. We continue to remain in
state `1' because we can hope to detect `10' pattern at the third input.
If the third input is 1, we revert to state `1' because at fourth input = 0 we can again hit the Jack Pot.
But if the third input is 0 at the fourth input we can never hit the Jack Pot hence we reset to `initial
`state.
Problem 2 : My customer has asked for `111' Sequence Detector . This should give an output HIGH only
when `111' sequence is detected.
Solution 2.1. Design of Mealy Machine as `111'sequence detector.
Figure 10.7
Figure 7. The state diagrams of Mealy Machine designed for detecting `111' pattern.
In Figure 7 we describe the state diagram of a Mealy Machine which will be a `111' sequence detector.
This Finite State Machine has three distinct states: Initial State, Got-1 state and Got-11 state.
Initial state should clearly be a reset state where input is 1 and output is 1.
CHAPTER 10.
130
When rst input is 0, machine remains in initial state with output LOW.
When rst input is 1, output remains LOW but FSM makes a transition to Got-1 state. The machine
is one step nearer the Jackpot.
When second input is 0, output remains LOW and machine reverts back to Initial State.
When second input is 1, output remains LOW but now it is two steps nearer the Jackpot hence FSM
makes a transition to Got-11 state.
When third input is 0, output remains LOW and the FSM resets as there is no chance of hitting the
Jackpot at the fourth input.
But when third input is 1, the Jackpot is hit and output is HIGH but FSM remains at Got-11 state
because at the fourth input , if 1, it can again hit the Jackpot.
Figure 10.8
Figure 8. Mealy State Machine for `111' sequence detection Circuit Implementation.
The TIMING DIAGRAM for the circuit in Figure 8 is given in Figure 9.
131
Figure 10.9
CHAPTER 10.
132
State
Da
Db
Qa|N
Qa|N+1
Qb|N
Qb|N+1
Z|N
Initial
Got-1_AB=01
Got-11_AB=10
Got-11_AB=10
Table 10.1
As can be seen in Figure 9 , X remains HIGH for some time when A_FF is SET and B_FF is RESET
at the third Lagging Edge of the Clock. This gives a `FALSE HIGH' known as `OUTPUT GLITCH'.
Solution 2.2. Design of Moore Machine as `111' sequence detector.
133
Figure 10.10
Figure 10. Four distinct States of Moore Machine for detecting a string of `111'.
As seen in Figure 10 there are four distinct states:
CHAPTER 10.
134
State
description
output
Initial
Initial/0
Got-1
`1'/0
Got-11
`11'/0
Got-111
`111'/1
Table 10.2
Present State
Next State
Output
X = 0
X = 1
Initial
Initial
Got-1
Got-1
Initial
Got-11
Got-11
Initial
Got-111
Got-111
Initial
Got-111
Table 10.3
We will use J-K FF and D-FF for the implementation Moore Machine as `111' string detector. Table 4
and Table 5 give the excitation table for J-K_FF and D_FF.
[Q(N) is the output before the clock and Q(N+1) is the output after the clock]
Q(n)
Q(n+1)
Comment
When
then
=0
K=0
gives
NOCHANGE condition
and
gives
K=1
RESET.
Hence O/P is 0 if
Q(N)=0;
135
When J =1 then
K=1
gives
GLE
TOG-
condition
and
K=0
gives
When
J=1
K=1
gives
GLE
and
gives
Hence
in
then
TOGJ=0
RESET.
O/P
either
is
case
if
Q(N)=1;
When
K=0
then
J=1
gives
SET
and
J=0
gives
NOCHANGE.
Hence
in
O/P
either
Q(N)=1;
Table 10.4
Q(n)
Q(n+1)
Table 10.5
These excitation tables have been derived from Truth-Table of J-K_FF and D_FF.
Table 6. Combined Truth Table of J-K_FF and D_FF.
Q(N+1)
Q(N+1)
No change
Q(N)
RESET
SET
TOGGLE
Q(N)*
Table 10.6
is
case
if
CHAPTER 10.
136
Present State
Input
Next State
FF_Inputs
Output
Ja
Ka
Db
Table 10.7
Simplifying Table 7 using Karnaugh's Map we get the following Logic Functions.
Ja = X.B
Ka = X*
Db = X(A+B)
Z = A.B
137
Figure 10.11
Figure 11. A Moore Machine Logic Circuit and FF conguration for `111' sequence detector.
The Timing Diagram for Moore Machine is shown in Figure 12.
Model. This is because the output depends on clearly dened states of the Flip-Flop which are synchronized
with clock. The outputs remain valid through out the logic state.
138
CHAPTER 10.
Figure 10.12
Chapter 11
DSD_Chapter 5_StateMachines_Part2_MooreMachineDesign
5.5 Designing and implementing Motor Rotation Sensor.
The customer wants a Motor Rotation Sensor. The sensor should indicate if the Motor is spinning in
Anti-Clockwise (Negative) or Clockwise (Positive) direction.
1 This
139
CHAPTER 11.
140
DSD_CHAPTER
Figure 11.1
141
Figure 11.2
STATES hence there are four distinct OUTPUTS. So we have two-bit CODE {a0 , a1} to dene the four
states and we have two-bit std_logic_vector output b0b1 to dene the four corresponding outputs.
The two-bit std_logic_vector input P1P2 are obtained from the sensors mounted over the encoding
disc which in turn is mounted on the axle of the rotating motor. The Clock of the REGISTER must be
synchronized with the motor speed so that all the four states are continuously monitored by the REGISTER.
If S2 state follows S1 then we have LED1 lit up which signies that negative rotation of the motor and
if S3 follows S1 then LED2 lights up signifying positive rotation.
CHAPTER 11.
142
DSD_CHAPTER
Figure 11.3
143
process(clk,reset)clocked process
begin
______if reset= '1' then
____________state<= s0;reset state
______elsif clk'event and clk= '1' then
____________case state is
____________when s0=>
__________________if in1 = "00" then
_______________________state<=s1;
_________________end if;
____________when s1=>
__________________if in1 = "10" then
________________________state<=s2;
__________________elsif in1 = "01" then
________________________state<=s3;
__________________elsif in1 = "11" then
________________________state<=s0;
__________________end if;
____________when others=> null;
____________end case;
______end if;
end process;
output_p:process(state) - combinational process
begin
case state is
when s0=> out1<= "00";
when s1=> out1<= "01";
when s2=> out1<= "10";
when s3=> out1<= "11";
when others=> null;
end case;
end process;
end Behavioral;
This is the complete VHDL description of MooreMachine_Rot_Sens.
By clicking Synthesis XST we do Syntax Check.
After we have made VHDL codes SYNTAX ERROR free, we click LEFT HAND CORNER of Synthesis
-XST. We get the following.
CHAPTER 11.
144
DSD_CHAPTER
Figure 11.4
145
Figure 11.5
Figure 11.6
CHAPTER 11.
146
DSD_CHAPTER
schematic we get the Technology Schematic as shown in Figure 6. In Figure 6, we have LUT(Look Up Table)
and FDC(Floppy Disk Controller). FDC is D Flip Flop with asynchronous CLEAR and Data Output.
Next we have Syntax Check. We have already done it and made our program syntax error free.
Next we have Generate Post Synthesis Simulation Model. This is for higher level synthesis. We will
not deal with it here.
Figure 11.7
147
COMPONENT mooremachinerotation_sensor
PORT(
clk : IN std_logic;
in1 : IN std_logic_vector(1 downto 0);
reset : IN std_logic;
out1 : OUT std_logic_vector(1 downto 0)
);
END COMPONENT;
Inputs
signal clk : std_logic := '0';
signal in1 : std_logic_vector(1 downto 0) := (others => '0');
signal reset : std_logic := '0';
Outputs
signal out1 : std_logic_vector(1 downto 0);
Clock period denitions
constant clk_period : time := 20 ns;
BEGIN
Instantiate the Unit Under Test (UUT)
uut: mooremachinerotation_sensor PORT MAP (
clk => clk,
in1 => in1,
reset => reset,
out1 => out1
);
Clock process denitions
clk_process :process
begin
____________clk
<=
'0';
<=
'1';
CHAPTER 11.
148
DSD_CHAPTER
Figure 11.8
Chapter 12
5.6 Designing and implementing Motor Rotation Sensor using Mealy Machine Design approach.
We will restate the problem here. Refer to Figure 1 of Chapter 5_Part 2. Input is a standard logic vector
of 2-bit length. It can be 00 , 01 , 10 , 11 .
If 00 is followed by 01 it denotes positive rotation.
If 00 is followed by 10 it denotes negative rotation.
In Moore Machine we have the following State Transition Table.
Table 1. State Transition Table of Mealy Machine.
Reset
In1
State
Out1
12
S0
00
No output
00
S0S1
01
No output.
0010
S1S2
10
0001
S1S3
11
0011
S1S0
00
No output
Table 12.1
1 This
149
150
CHAPTER 12.
Figure 12.1
Through Process P0, current state + IN1 generate the next state. Simultaneously current state through
Process P2 generates its unique OUT1.
151
Figure 12.2
If we compare the two architectures, Mealy Machine is denitely simpler to implement with less hardware.
State Transition Table of Mealy Machine.
Table 2. State Transition Table.
Reset
In1
State
Out1
`12'
S0
00
No output
`00'
S0S1
01
No output.
`00' `10'
S1S2
10
`00' `01'
S1S3
11
`00' `11'
S1S0
00
No output
Table 12.2
CHAPTER 12.
152
Figure 12.3
Figure 3. State Transition Diagram of Motor Rotation Sensor based on Mealy Machine
Design.
The arcs contain the input which causes the transition between the respective states as shown.
Now we will write the VHDL codes for Mealy Machine.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
- Uncomment the following library declaration if instantiating
- any Xilinx primitives in this code.
library UNISIM;
use UNISIM.VComponents.all;
entity MealyMachine_Rot_Sens is
Port ( clk : in STD_LOGIC;
___ reset : in STD_LOGIC;
___in1 : in STD_LOGIC_VECTOR(1 downto 0);
___out1 : out STD_LOGIC_VECTOR(1 downto 0));
end MealyMachine_Rot_Sens;
architecture Behavioral of MealyMachine_Rot_Sens is
type state_type is (s0,s1,s2,s3);
153
<=
s2;
<=
s3;
<=
s0;
______________________________end if;
_________________when others => null;
____________end case;
end if;
end process;
output_p: process(state,in1) - combinational process
begin
case state is
when s0 => if in1= "00" then
______________________________out1
<=
"01";
<=
"10";
<=
"11";
<=
______________________________else out1
"01";
<=
"00";
______________________________end if;
when s3=> if in1= "00" then
______________________________out1
<=
______________________________else out1
"01";
<=
"00";
______________________________end if;
when others => null;
end case;
end process;
end Behavioral;
CHAPTER 12.
154
We carry out Synthesize XST until we get syntax error free GREEN sign.
Now we dene the TEST BENCH:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY Tb_MealyMachine_Rot_Sens IS
END Tb_MealyMachine_Rot_Sens;
ARCHITECTURE behavior OF Tb_MealyMachine_Rot_Sens IS
Component Declaration for the Unit Under Test (UUT)
COMPONENT MealyMachine_Rot_Sens
PORT(
clk : IN std_logic;
reset : IN std_logic;
in1 : IN std_logic_vector(1 downto 0);
out1 : OUT std_logic_vector(1 downto 0)
);
END COMPONENT;
Inputs
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal in1 : std_logic_vector(1 downto 0) := (others => '0');
Outputs
signal out1 : std_logic_vector(1 downto 0);
Clock period denitions
constant clk_period : time := 20 ns;
BEGIN
Instantiate the Unit Under Test (UUT)
uut: MealyMachine_Rot_Sens PORT MAP (
____clk => clk,
____reset => reset,
____in1 => in1,
____out1 => out1
);
Clock process denitions
clk_process :process
begin
____________clk
<=
'0';
<=
'1';
155
Figure 12.4
156
CHAPTER 12.
Chapter 13
DSD_Chapter 5_Supplement_Optical
TERA BUS
1
as Data Bus as well as Instruction bus. As the Clock Speed go up, the problem is being compounded. In
giga-Hz clock range, metallic interconnects face skin eect and eddy current losses.
excessive resistance of the conducting wires and consequent high heat dissipation.
on the buses at very high frequency induces stray eddy current in the board's conducting part leading to
heavy eddy current energy losses. With increase in Clock Rate, attenuation along the copper buses increases
exponentially. At 2 GHz clock there is 50% attenuation and at 10GHz there is 98% attenuation. At few
GHz several resonances occur which cause signal to be reected at VIAS. Vias are vertical conductors that
connect two level components on Printed Circuit Board(PCB).
Apart from this there is severe cross-talk among the metallic interconnects leading to excessive bit-error
rate (BER). At 10 gigabits per second bit rates, cross talk blurs the signal after 1 meter of propogation
down the copper bus. With the increase in processing speed the problem of attenuation and cross-talk is
becoming more acute. Several methods were adopted to overcome the bandwidth bottleneck problem. The
foremost method amongst these is storing the current data in Cache Memory.
has been achieved within the microprocessor between processing core and on-chip cache memories but the
data exchange between the chip and external components ( say external memories) has been one order of
magnitude slower.
This bandwidth gap between the processor and the buses will continue to widen as processor performance
improves with scaling and improved processor architecture.
The problems of signal-loss and cross-talk is particularly severe in super-computers( massively parallel
machine) where we put together multi-chip modules together. Here the modules may be at two ends of the
PCB or may be in dierent racks of equipment.
Optical buses removes the problems of signal-loss, cross-talk problems and bandwidth bottleneck and
make the assembly of a supercomputer technically viable. Programming become simpler in supercomputers
using optically powered links because severe communication delays among processors donot have to be
compensated while writing the programs.
1 This
157
CHAPTER 13.
158
On 25
th September 1956 TAT-1, transoceanic voice-grade coaxial cables were laid down and trans-Atlantic
Year
Capability
2012
10PFlops
2016
100PFLOPS
2020
1000PFLOPS = 1ExaFLOPS(EFLOPS)
Table 13.1
TERA BUS Program was launched in 2003 as a collaborative program of IBM and Agilent.
The architecture of TERA BUS is given in Figure 1.
TERA BUS is essentially optical polymer waveguides interconnecting any number of modules of the
supercomputer.
The module of the supercomputer contains an opto-chip which interfaces the electrical
159
Figure 13.1
160
CHAPTER 13.
Chapter 14
or
ASSP
specic function that appeals to a wide market. As opposed to ASIC that combines a collection of functions
and designed by or for one customer, ASSPs are available as o-the-shelf components. ASSPs are used in
all industries, from automotive to communications.
Examples of ASSPs are integrated circuits that perform video and/or audio encoding and/or decoding.
The latest high-end devices: 28 nm silicon, more metallization layers than ever before, and equivalent
gate counts that would see any self-respecting ASIC proud.
found the greatest use in networking, DSP, and military/aerospace applications. These are domains where
raw performance requirements exceed those available from software-only solutions, but whose volumes cannot
always justify the costs of custom silicon development. These devices are more than capable of hosting a
full 32-bit soft processor core running at around 50 to 100 MHz as well as several soft peripherals such as a
video display driver, UART, Ethernet controller, or IDE controller.
Field-programmable gate arrays (FPGAs) have become incredibly capable with respect to handling
large amounts of logic, memory, digital-signal-processor (DSP), fast I/O, and a plethora of other intellectual
property (IP).At 28-nm, FPGAs deliver the equivalent of a 20- to 30-million gate application-specic
integrated circuit (ASIC). At this size, FPGA design tools, which have traditionally been used by just one
1 This
161
CHAPTER 14.
162
or two engineers on a project, begin to break down. It is no longer practical for a single engineer, or even
a very small design team, to design and verify these devices in a reasonable amount of time.Due to recent
technological developments, high-performance oating-point signal processing can, for the rst time, be easily
achieved using FPGAs. To date, virtually all FPGA-based signal processing has been implemented using
xed-point operations.
This white paper describes how oating-point technology on FPGAs is not only
practical now, but that processing rates of one trillion oating-point operations per second (teraFLOPS)
are feasibleand on a single FPGA die. Medical imaging equipment is taking on an increasingly critical
role in healthcare as the industry strives to lower patient costs and achieve earlier disease prediction using
noninvasive means. To provide the functionality needed to meet these industry goals, equipment developers
are turning to programmable logic devices such as Altera's FPGAs.
Consumer applications ranging from cell phones, computers, TVs and even digital picture frames are
incorporating wireless communication transceivers to implement broadband standards such as LTE(long
term evolution), WiMAX and WiFi to provide wireless connectivity to the outside world. These transceivers
rely on an analog interface in the digital baseband processor System-on-Chip (SoC) to connect with the RF
block. This analog interface is constantly evolving to adapt to the dierent communications standards.
We are going to use Spartan2 to implement Digital Systems desined using VHDL.
6.1. Design of BCD to-Seven Segment Decoder-Driver.
This is available as a MSI_IC chip by the TTL code name 7447. This converts a binary code into its
equivalent decimal magnitude and drives a Seven-Segment LED Display to display the corresponding decimal
magnitude. We will give the behavioral architecture description and implement it on Spartan2.
VHDL codes of BCD-to-Seven Segment Decoder is the following:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
- Uncomment the following library declaration if instantiating
- any Xilinx primitives in this code.
library UNISIM;
use UNISIM.VComponents.all;
entity BCD_to_Seven is
__Port ( bcd : in STD_LOGIC_VECTOR(3 downto 0);
______ seven : out STD_LOGIC_VECTOR(7 downto 1));
end BCD_to_Seven;
architecture Behavioral of BCD_to_Seven is
begin
_________process(bcd)
_______________begin
____________________case bcd is
________________________when"0000"=>seven<="0111111";
________________________when"0001"=>seven<="0000110";
________________________when"0010"=>seven<="1011011";
________________________when"0011"=>seven<="1001111";
________________________when"0100"=>seven<="1100110";
________________________when"0101"=>seven<="1101101";
________________________when"0110"=>seven<="1111101";
________________________when"0111"=>seven<="0000111";
________________________when"1000"=>seven<="1111111";
________________________when"1001"=>seven<="1101111";
________________________when others=> null;
____________________end case;
_________end process;
163
end Behavioral;
On clicking View Technology Schematic we get:
Figure 14.1
Figure 14.2
CHAPTER 14.
164
Figure 14.3
165
CHAPTER 14.
166
Figure 14.4
As we can see in the above graphical gure, corresponding to binary code 0000 we have the output
0111111. That is a,b,c,d,e,f LEDs are lit up and g is OFF. Hence we get a gure:
Figure 14.5
This Seven-Segment Display is an integral part of Digital Meters, Digital Clocks and Digital Instruments.
The Seven-Segment Display with the BCD-to-Seven Segment Decoder and N-Modulus Decade Counter is
the basic sub-system of Digital Clocks. This will be taken up later on in the chapter while designing hourminute-second clock.
Chapter 15
We will use it
in Digital Instruments, Clocks and Scoreboards to display decimal numbers which may indicate number of
items or hour-minutes-seconds or number of runs scored.
Digital Instruments, Clocks and Scoreboards use the basic sub-system of 7-Segment display for displaying
the decimal value of the binary code obtained from a counter. The counter may be counting some items
under processing or it may be counting hour-minutes-seconds or it may be counting the runs as the case may
be. A system displaying the overall count is a Finite State Sysem and its state diagram has to be drawn.
Here we will take up the design of a Cricket-Scoreboard as shown in Figure 1.
Figure 15.1
1 This
167
CHAPTER 15.
168
6.1.2. Controller.
The scoreboard will have a INITIALIZATION STATE and a COUNT STATE. Hence there are two well
dened States namely S0(Clear State) and S1(Count State). How the state transitions take place are shown
in Figure 2 , state diagram, and in Table 1, state table.
Figure 15.2
Figure 2. State Diagram of Cricket Scoreboard displaying the number of runs scored.
Table 1. State Table of the scoreboard.
169
If rstcnt has
reached 4 and rst =1 is persisting this means RESET has to done hence system reverts to S0
If inc = 1 and dec = 0, counter is incremented.
Add1 indicates that a increment has taken place.
If inc = 0 and dec = 1, counter is decremented.
Sub1 indicates that a decrement has taken place.
If rst = 0 then rstcnt is reset.
If { inc=1 and dec=1} or {inc=0 and dec=0} then
rstcnt is resetted and no change in the counter
Table 15.1
Table 2.
Figure 15.3
CHAPTER 15.
170
denes the array of TEN 7-bit vectors corresponding to TEN BCD codes which in turn represent the TEN
Decimal numbers from `0 to 9' and which are to be displayed on 7-segment displays.
The Look-Up Table has to be addressed by an INTEGER DATA TYPE. We will use conversion function
`to_integer' to generate the array index.
Let us consider the expression:
`seg7disp0<= seg7rom(to_integer(BCD0))';
Here `to_integer(BCD0)' converts BCD0(4-bit vector) to integer type data which is the row index of the
array of 7-bit vectors stored in seg7rom.
BCD addition is accomplished with `+' operator.
If current BCD0 count is less than 9, it is incremented.
If current BCD0 count is 9 then it is resetted and BCD1 is incremented.
Reverse logic is applied while decrementing.
If BCD0 count is greater than 0, BCD0 is decremented.
If BCD0 is zero and BCD1 count is greater than 0 then BCD1 is decremented and BCD0 is assigned 9.
Thus the counting proceeds on.
Following are the codes for the Cricket Scoreboard.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.numeric_bit.all;
entity Cricket_scoreboard is
Port ( clk : in bit;
rst : in bit;
inc : in bit;
dec : in bit;
seg7disp1 : out unsigned(7 downto 1);
seg7disp0 : out unsigned(7 downto 1));
end Cricket_scoreboard;
architecture Behavioral of Cricket_scoreboard is
signal state:integer range 0 to 1;
signal BCD1, BCD0:unsigned(3 downto 0) := "0000";unsigned bit vector
signal rstcnt: integer range 0 to 4 :=0;
type sevsegarray is array(0 to 9) of unsigned(6 downto 0);
constant seg7Rom: sevsegarray :=
("0111111","0000110","1011011","1001111","1100110","1101101",
"1111100","0000111","1111111","1100111"); active high with "gfedcba" order
begin
______process(clk)
______begin
___________if clk'event and clk = '1' then
_______________________case state is
________________________when 0=> initial state
<= "0000";
<= "0000"; clear the two decade counters
______________________________rstcnt <= 0; reset RESETCOUNTER
______________________________state <= 1;
________________________when 1 => -state in which scoreboard waits for inc and dec
______________________________BCD1
______________________________BCD0
171
____________________________________state
<=
0;
____________________________________else
_________________________________________rstcnt
<=
rstcnt + 1;
____________________________________end if;
____________________________________elsif inc = '1' and dec = '0' then
<= 0;
< "1001" then
_________________________________________BCD0 <= BCD0
____________________________________rstcnt
____________________________________if BCD0
+ 1; library
<
"1001" then
__________________________________________BCD1
__________________________________________BCD0
<=
<=
BCD1 + 1;
"0000";
____________________________________end if;
_______________________________elsif inc = '0' and dec = '1' then
<= 0;
> "0000"
then
___________________________________________BCD0
<=
____________________________________rstcnt
____________________________________if BCD0
BCD0
1;
>
"0000" then
__________________________________________BCD1
__________________________________________BCD0
<=
<=
BCD1 - 1;
"1001";
____________________________________end if;
______________________________elsif (inc = '1' and dec = '1') or (inc = '0' and dec
= '0')
____________________________________then rstcnt
<=
0;
______________________________end if;
__________________________when others=>null;
_____________________end case;
_______________end if;
__________end process;
seg7disp0
seg7disp1
<=
<=
end behavioral;
We carry out the syntax check. After it becomes error free we use Xilinx Synthesis Tool to synthesize
my system.
We can view the Synthesis Report.
Nexr we view RTL Schematic :
172
CHAPTER 15.
Figure 15.4
173
Figure 15.5
CHAPTER 15.
174
Figure 15.6
175
<=
'0';
<=
'1';
CHAPTER 15.
176
Figure 15.7
INDEX
177
Keywords are listed by the section with that keyword (page numbers are in parentheses).
Keywords
do not necessarily appear in the text of the page. They are merely associated with that section. Ex.
apples, 1.1 (1)
A
B
D
E
L
M
Ex.
apples, 1
AND,OR,XOR,NAND, 7(75)
O
P
S
T
U
V
178
ATTRIBUTIONS
Attributions
Collection: Digital System Design using VHDL
Edited by: Bijay_Kumar Sharma
URL: http://cnx.org/content/col11213/1.8/
License: http://creativecommons.org/licenses/by/3.0/
Module: "EC1561_Syllabus of Digital System Design using VHDL"
By: Bijay_Kumar Sharma
URL: http://cnx.org/content/m34860/1.4/
Page: 1
Copyright: Bijay_Kumar Sharma
License: http://creativecommons.org/licenses/by/3.0/
Module: "Digital System Design_Chapter 1_Part 1-Historical Background of IC Technology."
By: Bijay_Kumar Sharma
URL: http://cnx.org/content/m34693/1.4/
Pages: 3-16
Copyright: Bijay_Kumar Sharma
License: http://creativecommons.org/licenses/by/3.0/
Module: "Digital System_Design_Chapter 1_Part 2_Introduction to VLSI"
By: Bijay_Kumar Sharma
URL: http://cnx.org/content/m34695/1.3/
Pages: 17-26
Copyright: Bijay_Kumar Sharma
License: http://creativecommons.org/licenses/by/3.0/
Module: "DSD_Chapter 2_Basics of PLDs"
By: Bijay_Kumar Sharma
URL: http://cnx.org/content/m34939/1.3/
Pages: 27-41
Copyright: Bijay_Kumar Sharma
License: http://creativecommons.org/licenses/by/3.0/
Module: "Digital System Design_Chapter 2_Section 2_Wishlist of Digital System Designer."
By: Bijay_Kumar Sharma
URL: http://cnx.org/content/m34940/1.2/
Pages: 43-51
Copyright: Bijay_Kumar Sharma
License: http://creativecommons.org/licenses/by/3.0/
Module: "DSD_Chapter 3_VHDL._introduction and content"
By: Bijay_Kumar Sharma
URL: http://cnx.org/content/m34974/1.1/
Pages: 53-73
Copyright: Bijay_Kumar Sharma
License: http://creativecommons.org/licenses/by/3.0/
ATTRIBUTIONS
179
180
ATTRIBUTIONS
"DSD_Chapter
6_Mighty
Spartans
in
Action_Part
ments_Clocks+Scoreboard+the like"
By: Bijay_Kumar Sharma
URL: http://cnx.org/content/m35855/1.2/
Pages: 167-176
Copyright: Bijay_Kumar Sharma
License: http://creativecommons.org/licenses/by/3.0/
1_Digital
Instru-
About Connexions
Since 1999, Connexions has been pioneering a global system where anyone can create course materials and
make them fully accessible and easily reusable free of charge. We are a Web-based authoring, teaching and
learning environment open to anyone interested in education, including students, teachers, professors and
lifelong learners. We connect ideas and facilitate educational communities.
Connexions's modular, interactive courses are in use worldwide by universities, community colleges, K-12
schools, distance learners, and lifelong learners.
English, Spanish, Chinese, Japanese, Italian, Vietnamese, French, Portuguese, and Thai. Connexions is part
of an exciting new information distribution system that allows for
Connexions
has partnered with innovative on-demand publisher QOOP to accelerate the delivery of printed course
materials and textbooks into classrooms worldwide at lower prices than traditional academic publishers.