Report On Linux or VHDL
Report On Linux or VHDL
Report On Linux or VHDL
REPORT
ON
PRACTICAL TRAINING
TAKEN AT
LINUX SOFT TECHNOLOGIES
PVT. LTD., JAIPUR
Submitted in the Partial Fulfillment of the
Requirements for the
Award of the Degree of
BACHELOR OF TECHNOLOGY
in
ELECTRONICS & COMMUNICATION ENGG.
SESSION 2009-10
Submitted by:-
Ankur Bhat
(B.Tech. VII Sem)
Roll No.-060207
ANKUR BHAT
COMPANY PROFILE
Linux Soft Technologies Pvt. Ltd., Jaipur is the Redhat
Authorized training partner, exam centre & Registered with Govt. of
India.They are the leading Training–Solution-Development organization
of Redhat Linux, Oracle, Cisco, Microsoft, Sun Microsystems, VHDL /
VLSI & ROBOMAKING-EMBEDDED SYSTEMS. They have been providing
services in imparting training and solution in Networking domain &
Programming covering LAN, MAN, WAN with the complete offerings in
Internet Security.
Redhat Linux
Software Development
Electronic Projects
Database Solution
PREFACE
This report describes an practical training based on VLSI/VHDL which
was done under the supervision of Mr. Himanshu Bhojwani by a group of
eight Engineering students. The objective of this practical training was to
develop an approach to make VHDL based real time applications working on
digital logics. The hardware and software tools used are those manufactured
and developed by Altera and the VLSI circuit has been designed on a CPLD
kit. A basic understanding of electronic devices, digital electronics and VLSI
software and hardware tools is a pre-requisite.
CONTENTS
1 INTRODUCTION TO VLSI
1.1 HISTORICAL PERSPECTIVE
1.2 COMPANIES INVOLVED
1.3 ABOUT ALTERA
1.4 METHODS OF DESIGN
1.5 APPLICATION SPECIFIC INTEGRATED CIRCUIT
1.6 PROGRAMMABLE LOGIC DEVICES
2 INTRODUCTION TO VHDL
2.1 NEED OF VHDL
2.2 ADVANTAGES OF VHDL
2.3 DIFFERENCES BETWEEN VHDL AND OTHER PROCEDURAL
LANGUAGES
2.4 CAPABILITIES OF VHDL
2.5 VHDL TERMS
2.6 STYLES OF MODELING
2.7 VHDL DESIGN FLOW
2.8 VHDL BASIC FILE STRUCTURE
2.9 VHDL EXPRESSIONS AND OPERATORS
3 PROGRAMMING IN VHDL
3.1 HALF ADDER
3.2 FULL ADDER
3.3 4-BIT ADDER CUM SUBTRACTOR
3.4 2TO4 DECODER
3.5 4TO1 MULTIPLEXER
3.6 3TO8 DECODER USING 2TO4 DECODER
3.7 D FLIP FLOP
4 COMPONENTS USED IN THE DESIGN
4.1 RESISTORS
4.2 VARIABLE RESISTORS
4.3 CAPACITORS
4.4 DIODES
4.5 SWITCHES
4.6 TRANSISTORS
4.7 RELAY
4.8 POWER SUPPLY
4.9 PRINTED CIRCUIT BOARD
4.10 ELT II KIT
4.11 SOFTWARE TOOL- QUARTUS II
5 EXPERIENCE DURING TRAINING
6 SUGGESTION FOR IMPROVEMENT & IMPLEMENTATION FOR
STUDENTS
7 BIBLIOGRAPHY
1. INTRODUCTION TO VLSI
In an era of newly emerging technologies demanding fastest possible
operations with minimum possible equipment size, integrated circuit chips
have become a popular choice for developers. Very Large Scale Integration
(VLSI) based on logic density upto about 1,00,000 logic devices per cubic
millimeter, is emerging as the latest trend in IC fabrication.
.
S.No. CPLD FPGA
1 Complex Programmable Logic Device Field Programmable Gate Array
2 Field Programmable Gate Array Gate density-over 1 lakh devices
3 Non-volatile Volatile
4 Low cost Expensive
5 Slow Fast
6 Not ideal for ASIC design Ideal for ASIC design
7 Ideal for custom solutions Not ideal for custom solutions
The circuit design on a VLSI kit may be accomplished by any one of the
following
methods:-
(1) Schematic/Block editor
(2) VHDL coding
(3) Verilog coding
Schematic/Block editor
VHDL Coding
Verilog Coding
It is another programming language for designing hardware using
software design techniques. Despite of having similar applications, VHDL is
more popular at trainee level circuit design.
Kits Used
● Types of ASIC
1) Full custom ASIC
2) Standard cell based ASIC
3) Gate array based ASIC
4) Programmable ASIC
Standard Cells ASIC
These are designed using cells of transistors already connected and
compactly routed to form higher level functions as flip flops, adders,
counters etc. The designer connects these logic functions and the software
tries to place them on a die and connect them in the most efficient way.
Each cell consists of all the material layers needed to produce the transistors
and connect them. A typical standard cell is shown in the figure. A major
disadvantage of a standard cell ASIC is that the number of gates cannot be
optimized.
Figure 2: Standard Cell Based ASIC
● Disadvantages of ASIC
PLDs are standard ICs available from a standard catalogue and sold in
a very high volume to a variety of customers. As they can be configured as
per specific application demands, so they also belong to the family of ASICs.
Features :-
No customized mask layers.
Quick design turnaround.
Single block of interconnects which are programmable.
A matrix of logic macro cells.
Where:
PLD=Programmable Logic Device
SPLD= Simple Programmable Logic Device
CPLD= Complex Programmable Logic Device
PROM= Programmable Read Only Memory
PLA= Programmable Logic Array
PAL= Programmable Array Logic
● PROM
Programmable Read Only Memories are simply memories that
can be inexpensively programmed by the user to contain a specific pattern.
The pattern can be used to represent a microprocessor program, a simple
algorithm or a state machine. PROM could be either OTP (One Time
Programmable) or multiple time programmable (such as EPROM or EEPROM).
Earlier PROMs were meant to be only memory devices. But with their
introduction in market, they were also started being used as programmable
logic devices. A major advantage of PROM is that any process can be stored
whether logical or not, which is not the case with other PLDs.
Demerits of PROM :-
1. Memory locations are wasted.
2. More time consuming process.
● PLA
● CPLD
The blind race for bigger (in terms of functions), smaller (in terms
of physical size), faster, more powerful and cheaper devices lead to more
sophisticated PLDs. In 1984, Altera (newly formed) introduced a CPLD based
on a combination of CMOS and EPROM technologies. This new innovation
was found to have tremendous functional density and complexity while
consuming relatively less power. Basing the programmability on EPROM cells
made them ideal for development and prototyping solutions.
Figure 6: A generic CPLD structure
● FPGA
Field Programmable Gate Array, rather than being structured by
PAL or other programmable devices, is structured very much like a Gate
Array ASIC. Hence it is more suitable for prototyping ASICs. Each FPGA
vendor has its own architecture which is nothing but a variation of the
architecture shown in figure 9. FPGA has configurable logic blocks,
configurable I/O blocks and programmable interconnect. Clock circuitry is
provided within the chip. Two basic programmable elements used in FPGA
are SRAM (for interconnects) and antifuse (for configuration).
2. INTRODUCTION TO VHDL
VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware
Description Language. In the mid-1980's the U.S. Department of Defense
and the IEEE
sponsored the development of this hardware description language with the
goal to develop very high-speed integrated circuit. It has become now one of
industry's standard languages to describe digital systems. The other widely
used hardware description language is Verilog. Both are powerful languages
that allow us to describe and simulate complex digital systems. A third HDL
is ABEL (Advanced Boolean Equation Language) which was specifically
designed for Programmable Logic Devices (PLD). ABEL is less powerful than
the other two languages and is less popular in industry. This section deals
with VHDL, as described by the IEEE standard 1076-1993.
With the evolution of the HDL the designers have to just write the code
for a particular logic, whether this code is for the simple AND gate or for the
complex microprocessor. The HDL will automatically produce the virtual
hardware description for that particular logic. With the advent of the
synthesis and the simulation tools now it is possible to generate the other
technical details of the circuit also such as timing reports, placing & routing
reports, delay reports etc. It is also possible now to virtually implement and
check the circuit inside that computer. So the HDL has been revolutionary in
the era of electronics technology.
Portability: The same VHDL code can be simulated and used in many
design tools and at different stages of the design process. This reduces
dependency on a set of design tools whose limited capability may not be
competitive in later markets. The VHDL standard also transforms design data
much easier than a design database of a proprietary design tool.
Modeling Capability: VHDL was developed to model all levels of designs,
from electronic boxes to transistors. VHDL can accommodate behavioral
constructs and mathematical routines that describe complex models, such as
queuing networks and analog circuits. It allows use of multiple architectures
and associates with the same design during various stages of the design
process. VHDL can describe low-level transisitors up to very large systems.
Bus: The term bus is used to bind a group of signals at one position.
Logic Optimization
Technology Mapping
Placement
Routing
Programming Unit
Configured FPGA
VHDL uses reserved Key works that cannot be used as signal names or
identifiers. Keywords and user-defined identifiers are case insensitive. Lines with
comments start with two adjacent hyphens (--) and will be ignored by the compiler.
VHDL also ignores line breaks and extra spaces. VHDL is a strongly typed
language which implies that one has always to declare the type of every object that
can have a value, such as signals, constants and variables.
The logical operators and, or nand, nor, xor and not operate on values of
type bit or Boolean, and also on one –dimensional arrays of these types. For array
operands, the operation is applied between corresponding elements of each array,
yielding an array of the same length as the result. For bit and
Boolean operands, and or, nand, and nor are ‘short-circuit’ that is they only
evaluate their right operand if the left operand does not determine the result. So
and and nand only evaluate the right operand if the left operand is false or ‘0’
The relational operators =,/= <,> and > =must have both operands of the
same type, and yield Boolean results. The equality operators (=and /=) can have
operands of any type. For composite types, two values are equal if all of their
corresponding elements are equal. For composite type, two values are equal if all
of their corresponding elements are equal. The remaining operators must have
operands which are scalar types or one-dimensional arrays of discrete types.
The sign operators (+ and -) and the addition (+) and subtraction (-)
operators have their usual meaning on numeric operands. The concatenation
operator (&) operators on one-dimensional arrays to form a new array with the
contents of the right operand following the contents of the left operand. It can also
concatenate a single new element to an array, or two individual elements to form
an array. The concatenation operator is mist commonly used with strings.
The multiplication (*) and division (/) operators work on integer, floating
point and physical types. The modulus (mod) and remainder (rem) operators only
work on integer types. The absolute value (abs) operator only work on any numeric
type. Finally, the exponentiation (**) operator can have an integer or floating point
left operand, but must have an integer right operand. A negative right operand is
only allowed if the left operand is a floating point number.
The order of precedence is the highest for the operators of class 7, followed
by class 6 the lowest precedence for class 1. Unless parentheses are used, the
operators with the highest precedence are applied first. Operators of the same class
have the same precedence are applied form left to right in an expression. As an
example, consider the following std_ulogic_vectors, X (=’010’), and Z (‘101110’).
The expression
Not X & Y xor Z rol 1
Is equivalent to ((notX) & Y) xor (Z rol 1) = ((101) & 10) xor (0101100) xor
(01011) =11101. The xor is executed on a bit-per-bit basis.
Logical Operators
The logic operators (and, or nand, nor, xor and xnr) are defined for the “bit”
“Boolean” “std_logic” types and their vectors. They are used to define Boolean
logic expression or to perform bit-per-bit operations on arrays of bits. Operations
on arrays of bits. They give a result of the same type as the operand (Bit or
Boolean). These operators can applied to signals, variables and constants.
Notice that the nand and nor operators are not associative. One should use
parentheses in a sequence of nand or nor operators to prevent a syntax error:
X nand Y nand Z will give a syntax error and should be written as (X nand Y)
nand Z.
Relational operators
The relational operators test the relative values of two scalar types and give
and give as result a Boolean output of “TRUE” or FALSE”.
Notice that symbol of the operator “<=” (smaller or equal to ) the same one the
assignment operator used to assign a value to a signal or variable. In the following
examples the first “<=” symbol is the assignment operator. Some examples of
relational operations are:
STS <= ((A > =B_COUNT) or (A > C)); - - will result in “TRUE”
STD <=(std_logic (‘1’, ‘0’, ‘1’) < std_logic (‘0’, ‘1’, ‘1’ ));- - makes STS
“FALSE”
STD <= (A1 <A2); will result in “TRUE” since ‘1’ occurs to the left of ‘Z’
For discrete array types, the comparison is done on an element –per-element basis,
starting form the left towards the right, as illustrated by the last two examples.
Shift operators
The operand is on the left of the operator and the number (integer) of shifts is on
the right side of the operator. As an example,
When a negative integer is given, the opposite action occurs, i.e. a shift to the left
will be a shift to the right. As an example
NUM 1 srl-2 would be equivalent to NUM 1 sll 2 and give the result “01011000”.
Other examples of shift operations are for the bit_vector A = “1010001”
Addition operators
Unary operators
The unary operators “+” and “-“are used to specify the sign of a numeric
type. Multiplying operators are used to perform mathematical functions on numeric
types (integer).
The multiplication operator is also defined when one of the operands is a physical
type and the other an integer or real type.
The result of the rem operator has the sign of its first operand while the of the mod
operators has sign of the second operand.
11 rem 4 results in 3
(-11) rem 4 results in-3
9 mod 4 results in 1
7 mod (-4) results in -1 (7-4*2=-1).
Miscellaneous operators
These are the absolute value and exponentiation operators that can be
applied to numeric types. The logical negation (not) results in the inverse polarity
but the same type.
3. PROGRAMMING IN VHDL
3.1 HALF ADDER
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity HA is
port(A,B:in STD_LOGIC; Sum, Carry:out STD_LOGIC);
end HA;
architecture struct of HA is
component myXOR
port(in1,in2:in STD_LOGIC; out1:out STD_LOGIC);
end component;
begin
X1: myXOR port map(A,B,Sum);
Carry<=A and B;
end struct;
VHDL Code(Dataflow):
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY addersub4d IS
PORT(A,B:IN BIT_VECTOR(3 DOWNTO 0);
SEL:IN BIT;
COUT:OUT BIT;
X:OUT BIT_VECTOR(3 DOWNTO 0));
END addersub4d;
ARCHITECTURE dataflow OF addersub4d IS
BEGIN
PROCESS(A,B,SEL)
VARIABLE S:BIT_VECTOR(3 DOWNTO 0);
VARIABLE C:BIT_VECTOR(4 DOWNTO 0);
BEGIN
C(0):=SEL;
FOR i IN 0 TO 3 LOOP
S(i):=A(i) XOR B(i) XOR C(i) XOR SEL;
C(i+1):=(B(i) XOR SEL) AND A(i);
END LOOP;
COUT<=C(4);
X<=S;
END PROCESS;
END dataflow;
3.4 2 TO 4 DECODER
VHDL code
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY dec24d IS
PORT(A,B,EN_L:IN BIT;
Q0,Q1,Q2,Q3:OUT BIT);
END ENTITY;
ARCHITECTURE dataflow OF dec24d IS
BEGIN
Q0<=(NOT A)AND (NOT B) AND (NOT EN_L);
Q1<=( A)AND (NOT B) AND (NOT EN_L);
Q2<=(NOT A)AND (B) AND (NOT EN_L);
Q3<=(A)AND (B) AND (NOT EN_L);
END dataflow;
3.5 4 TO 1 MULTIPLEXER
VHDL CODE: (behavioral code)
LIBRARY IEEE;//standard library.
USE IEEE.STD_LOGIC_1164.ALL;//importing standard library.
USE IEEE.STD_LOGIC_ARITH.ALL;
//entity declaration
ENTITY 4mux1 IS
PORT(A,B,C,D:IN STD_LOGIC;
S0,S1: IN STD_LOGIC;
Q:OUT STD_LOGIC);
END 4mux1;
//end of entity declaration
ARCHITECTURE behave OF 4mux1 IS
BEGIN
PROCESS(A,B,C,D,S0,S1)//sensitivity list.
BEGIN
IF S0='0' AND S1='0' THEN Q<='A';
ELSIF SO='1' AND S1='0' THEN Q<='B';
ELSIF SO='0' AND S1='1' THEN Q<='C';
ELSE Q<='D';
END IF;
END PROCESS;
END behave;//end of architecture.
3.6 3TO8 DECODER USING 2TO4 DECODER
VHDL CODE:
LIBRARY IEEE;//standard library
USE IEEE.STD_LOGIC_1164.ALL;//importing the libraray
//entity declaration...
ENTITY decoder38 IS
PORT(A,B,C:IN BIT;
Q0,Q1,Q2,Q3,Q4,Q5,Q6,Q7:OUT BIT);
END ENTITY;
//end of entity declaration.
ARCHITECTURE struc OF decoder38 IS
//component declaration..
COMPONENT decoder24 IS
PORT(S0,S1,EN_L:IN BIT;Q0,Q1,Q2,Q3:OUT BIT);
END COMPONENT;
COMPONENT INVERT
PORT(A:IN BIT;B:OUT BIT);
END COMPONENT;
//signal declaration..
SIGNAL CINV:BIT;
BEGIN
I0:INVERT PORT MAP(C,CINV);
D0:decoder24 PORT MAP(A,B,C,Q0,Q1,Q2,Q3);
D1:decoder24 PORT MAP(A,B,CINV,Q4,Q5,Q6,Q7);
END struc;//
VHDL CODE
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY ffD IS
PORT(D,CLK,RESET:IN BIT;
Q,QINV:OUT BIT);
END ffD;
ARCHITECTURE behav OF ffD IS
BEGIN
PROCESS
BEGIN
WAIT UNTIL CLK='1' AND CLK 'EVENT;
IF(RESET='1') THEN Q<='0';QINV<='1';
ELSIF D='1' THEN Q<='1';QINV<='0';
ELSE Q<='0';QINV<='1';
END IF;
END PROCESS;
END behav;
4.3 Capacitors
4.4 Diodes
Diodes are components that allow current to flow in only one direction.
They have a positive side (leg) and a negative side. When the voltage on the
positive leg is higher than on the negative leg then current flows through the
diode (the resistance is very low). When the voltage is lower on the positive
leg than on the negative leg then the current does not flow (the resistance is
very high). The negative leg of a diode is the one with the line closest to it. It
is called the cathode. The positive end is called the anode. Usually when
current is flowing through a diode, the voltage on the positive leg is 0.65
volts higher than on the negative leg
4.5 Switches
4.6 Transistor
4.7 Relays
Here diode D1, D2, D3 and D4 forms half wave rectifier. Capacitor C1 is
filtering capacitor.IC-7809 is used for voltage regulation. Capacitor C2 is used
for bypassing, if any ripples are present then it eliminates those ripples.
As IC-7809 is used so it gives 9V DC regulated voltage ideally. If we
take 16 volts transformer then we will get 8.97V at output. Thus voltage is
regulated.
Types of PCB’s: -
FEATURES:-
• Based on MAX II CPLD EPM240T100Cx.
• 41 General Purpose IOs (+5V tolerant) available on the standard
Santa Cruz short expansion footprint.
• 10 CPLD clock selection option available through jumper selection
along with the dual crystal support on the board, making the clock
selection choices 10x2 = 20 (2 Hz upto 230.4 Khz).
• 4-Digit scanning 7-Segment LED Display Interface.
• 8x2 On-Off Push Button switches shared with IO headers, giving
flexibility of additional 16 general purpose IOs (+5V tolerant).
• 4x4 Momentary Push Button Switch Matrix and 8 LEDs shared and
configured through 4 Jumper selection options to use them in any of
the possible available combinations.
BLOCK DIAGRAM:-
BOARD COMPONENTS
4.11 Software Tool: Quartus II
The software tool used for hardware design of the project was Quartus
II. It is a tool provided by Altera to design and simulate VLSI circuits through
simple schematic design or by using hardware description languages such as
VHDL and Verilog. In this project we have used schematic design technique
for circuit design. After design and simulation on Quartus, the circuit can be
downloaded as a '.bdf' file on the ELT II board.
This training programme provided the best it could , taking into account the
time and resource limitations. However, the quality could be improved by
increasing the time duration of such summer training programmes. Also, the
companies should be transparent in their strategies so that the students can
choose the programme best suited to their requirements.
The students can implement such training for getting hands-on experience
over the theoretical knowledge acquired by them throughout their degree
and inculcating values like team spirit and professionalism.
7. BIBLIOGRAPHY
1. Principles of CMOS VLSI Design by Neil H. Weste and Kamran Eshraghian.
2. VHDL Programming by Example by Douglas L. Perry.
3. Entry Level Tool II – Reference Manual provided by System Level Solutions,
Inc.
(USA).