56
A 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 DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING Government Engineering College Ajmer

report on linux or vhdl

Embed Size (px)

Citation preview

Page 1: report on linux or vhdl

AREPORT

ONPRACTICAL TRAINING

TAKEN ATLINUX SOFT TECHNOLOGIES

PVT. LTD., JAIPURSubmitted in the Partial Fulfillment of the

Requirements for theAward of the Degree of

BACHELOR OF TECHNOLOGYin

ELECTRONICS & COMMUNICATION ENGG.

SESSION 2009-10

Submitted by:-Ankur Bhat

(B.Tech. VII Sem)Roll No.-060207

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Government Engineering College Ajmer(An Autonomous Institution of Govt. of Rajasthan)

Badaliya Circle, Ajmer-305001

Page 2: report on linux or vhdl

ACKNOWLEDGEMENTI am greatly privileged to express my sincere thanks to Mr. Rohit

Gupta, Director, Linux Soft Technologies Pvt. Ltd., Jaipur for the opportunity he has provided me, and making the requisite facilities readily available for experimental work.

I feel immensely proud in extending my heartiest thanks to Mr. Himanshu Bhojwani, Director, Contrivance IT Solutions Pvt. Ltd, for his inspiring guidance, encouragement, unconditional cooperation and support, which has greatly contributed towards the successful completion of this work. He has been a source of inspiration for all of us and his experience and knowledge has helped us in learning and giving this project the shape it has assumed.

I offer my heartfelt thanks to Mr. M.C. Govil, Principal, Government Engineering College, Ajmer and Mr. Dhirendra Mathur, Training & Placement Officer, Government Engineering College, Ajmer for providing me an opportunity to undergo this training. I am also grateful to Mrs. Rekha Mehra, Head of Department, Electronics & Communication, Government Engineering College, Ajmer for his proper guidance, encouragement and support. The help by other faculty members is also greatly acknowledged.

I also wish to thank my family and friends for motivating, encouraging and giving moral support to accomplish this project successfully.

ANKUR BHAT

Page 3: report on linux or vhdl

COMPANY PROFILELinux 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.

Based on their extensive support experience with a variety of customers, Linux Soft Technologies Pvt. Ltd. has developed a unique approach for technical support. They offer consulting and planning, integration and maintenance services for many open source projects, allowing you to deploy them across your network with complete peace of mind. With growing popularity and acceptance of Linux, RoboMaking, VLSI, Oracle, and Routers in the govt. sector we started a company, The Linux Soft Technologies Pvt. Ltd. to provide all Computer based solutions under one roof.

Linux Soft Technologies Pvt. Ltd. is1) An Authorized Redhat Training partner & Exam Centre from

USA, Microsoft Certified Solution Provider (MCSP) & Cisco Solution Provider.

2) Training, Solution & Development Company Registered by Govt. of INDIA.

Linux Soft Technologies Pvt. Ltd. is providing Training program on following Technologies –

Red Hat Linux – RHCT, RHCE

Cisco System – CCNA, CCNP, CSPFA

Page 4: report on linux or vhdl

Microsoft – MCP, MCSA, MCSE 2003, VB.Net, ASP.Net, C#.Net

CompTia – A+, Network+

Sun Microsystems – Java, J2EE

Oracle – Oracle DBA/Developer

VHDL/VLSI, Robomaking / Embedded Systems

Security – CEH, CCSA

Linux Soft Technologies Pvt. Ltd. Is providing Solution on following Technologies –

Redhat Linux

Cisco Router – Switch Implementation

Windows Server Installation & Configuration

Cisco Pix Firewall Implementation

Web Hosting, Domain Registration

Web Site Development, Web Solution

Software Development

Electronic Projects

Database Solution

Page 5: report on linux or vhdl

PREFACEThis 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.

Page 6: report on linux or vhdl

CONTENTS1 INTRODUCTION TO VLSI

1.1 HISTORICAL PERSPECTIVE1.2 COMPANIES INVOLVED1.3 ABOUT ALTERA1.4 METHODS OF DESIGN1.5 APPLICATION SPECIFIC INTEGRATED CIRCUIT1.6 PROGRAMMABLE LOGIC DEVICES

2 INTRODUCTION TO VHDL2.1 NEED OF VHDL2.2 ADVANTAGES OF VHDL2.3 DIFFERENCES BETWEEN VHDL AND OTHER PROCEDURAL LANGUAGES2.4 CAPABILITIES OF VHDL2.5 VHDL TERMS2.6 STYLES OF MODELING2.7 VHDL DESIGN FLOW2.8 VHDL BASIC FILE STRUCTURE2.9 VHDL EXPRESSIONS AND OPERATORS

3 PROGRAMMING IN VHDL3.1 HALF ADDER3.2 FULL ADDER3.3 4-BIT ADDER CUM SUBTRACTOR3.4 2TO4 DECODER3.5 4TO1 MULTIPLEXER3.6 3TO8 DECODER USING 2TO4 DECODER3.7 D FLIP FLOP

4 COMPONENTS USED IN THE DESIGN4.1 RESISTORS

Page 7: report on linux or vhdl

4.2 VARIABLE RESISTORS4.3 CAPACITORS4.4 DIODES4.5 SWITCHES4.6 TRANSISTORS4.7 RELAY4.8 POWER SUPPLY4.9 PRINTED CIRCUIT BOARD4.10 ELT II KIT4.11 SOFTWARE TOOL- QUARTUS II

5 EXPERIENCE DURING TRAINING6 SUGGESTION FOR IMPROVEMENT & IMPLEMENTATION FOR STUDENTS7 BIBLIOGRAPHY

1. INTRODUCTION TO VLSIIn 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.

1.1 Historical Perspective

The electronics industry has achieved a phenomenal growth over the last few decades, mainly due to the rapid advances in integration technologies and large-scale systems design. The use of integrated circuits in high performance computing, telecommunications, and consumer electronics has been growing at a very fast pace.Typically, the required computational and information processing power of these applications is the driving force for the fast development of this field.

The current leading-edge technologies (such as low bit-rate video and cellular communications) already provide the end-users a certain amount of processing power and portability. This trend is expected to continue, with very important implications for VLSI and systems design. One of the most important characteristics of information services is their increasing need for very high processing power and bandwidth. The other important characteristic is that the information services tend to become more personalized, which means that the information devices must be more

Page 8: report on linux or vhdl

intelligent and also be portable to allow more mobility. This trend towards portable, distributed system architectures is one of the main driving forces for system integration, even though it does not preclude a concurrent and equally important trend towards centralized, highly powerful information systems such as those required for network computing and video services.

Figure1: Prominent “driving” trends in information service technologies.

As more and more complex functions are required in various data processing and telecommunications devices, the need to integrate these functions in a small package is also increasing. The level of integration as measured by the number of logic gates in a monolithic chip has been steadily rising for almost three decades, mainly due to the rapid progress in processing technology and interconnect technology. Table1 shows the evolution of logic complexity in integrated circuits over the last three decades, and marks the milestones of each era. Here, a logic block may contain anywhere from 10 to 100 transistors, depending on the function.

Era Date Complexity(# of logic blocks per

chip)Single Transistor 1958 <1Unit logic (one gate) 1960 1Multi-function 1962 2-4Complex function 1964 5-20Medium Scale Integration (MSI) 1967 20-200Large Scale Integration (LSI) 1972 200-2000Very large Scale Integration (VLSI) 1978 2000-20,000Ultra Large Scale Integration (ULSI) 1989 >20,000

Table 1: Evolution of logic complexity in integrated circuits

Note that the term VLSI has been used continuously even for chips in the ULSI (Ultra Large Scale Integration) category, not necessarily abiding by the distinction in Table 1.

Page 9: report on linux or vhdl

The monolithic integration of a large number of functions on a single chip usuallyprovides:

Less area/volume and therefore, compactness

Less power consumption

Less testing requirements at system level

Higher reliability, mainly due to improved on-chip interconnects

Higher speed, due to significantly reduced interconnection length

Significant cost savings

Therefore, the current trend of integration will continue in the foreseeable future.Advances in device manufacturing technology allow the steady reduction of minimum feature size. Nowadays, programmable VLSI devices are also being manufactured by companies like Xilinx and Altera.

1.2 Companies InvolvedPresently, the programmable VLSI are mainly being manufactured by

1. Xilinx2. Altera

1.3 About AlteraAltera is one of the leading companies involved in the manufacturing of

programmable VLSI devices such as CPLD (Complex Programmable Logic Devices) and FPGA (Field Programmable Gate Array). They also design development boards or kits for learners and experimentation purposes. Other areas of expertise include IP cores (processor/ ASIC core) and add-on boards for interfacing (USB devices, analog- to-digital converter etc.). The points of comparison of CPLD and FPGA are tabulated in Table2

.S.No. CPLD FPGA1 Complex Programmable Logic Device Field Programmable Gate Array2 Field Programmable Gate Array Gate density-over 1 lakh devices3 Non-volatile Volatile

Page 10: report on linux or vhdl

4 Low cost Expensive5 Slow Fast6 Not ideal for ASIC design Ideal for ASIC design7 Ideal for custom solutions Not ideal for custom solutions

Table 2: Comparison of CPLD and FPGA kits

1.4 Methods Of Design

The circuit design on a VLSI kit may be accomplished by any one of the followingmethods:-

(1) Schematic/Block editor(2) VHDL coding(3) Verilog coding

Schematic/Block editor

Some softwares like Quartus II provide the facility of schematic designing of circuit. In this, first the circuit is drawn with the help of various tools on the design window. Then this design is compiled and pin assignments are done with reference from manual. A JECDC file is generated which is programmed into the VLSI chip. This method is a purely hardware form of circuit design although a software is used as tool because in the final chip connections are made through hardware implementation.

VHDL Coding

VHDL refers to Very large scale integration Hardware Description Language. It provides a facility for designing electronic and digital circuits on chips using software design techniques. VHDL has been explained in detail in a later section.

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

Page 11: report on linux or vhdl

Altera manufactures the following kits as per their applications :-1) ELT II (CPLD)2) ESDK (FPGA)3) DE I (Codec Development Kit)

In this project ELT II kit has been used.

1.5 Application Specific Integrated CircuitAs the name suggests, ASICs are integrated circuits designed

specifically to perform tasks related to a single application. For example, a chip designed for use in cellphone is an ASIC. These kind of chips can be designed by an engineer with no particular knowledge of semiconductor physics.

● ASIC at its beginningInitially, the ASIC technology was known as gate array

technology. Ferranti produced the first gate array- ULA (Universal Logic Array). The later versions were generalized with different base dies customized by both metal and polysilicon layer. The designer would choose a manufacturer and implement the design with the tools available with the designer

● Types of ASIC1) Full custom ASIC2) Standard cell based ASIC3) Gate array based ASIC4) Programmable ASIC

Standard Cells ASICThese 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.

Page 12: report on linux or vhdl

Figure 2: Standard Cell Based ASIC

Masked Gate Array ASICIt consists of rows and columns of regular transistor structures. The

basic cells orgates are nothing but the same number of unconnected transistors. Design is implemented byconnecting these gates according to the circuit requirements. Lower level logic isimplemented first. In the manufacturing of gate array, the unrouted die is processed exceptthe last metal layer which would be done after the design. Although this method providesflexibilty in connections so that design can be optimized, the process is quite tedious.

Figure 3: Gate Array

● Disadvantages of ASIC

1. Manufacturing process is lengthy and time consuming.2. Long design time.3. Design verification is done during final implementation which results in

more bugs.4. As they are produced in bulk, they are not ideal for custom solutions.

Page 13: report on linux or vhdl

These disadvantages led to the development of newer and more evolved

alternatives such as the programmable logic devices.

1.6 Programmable Logic Devices

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.

Hierarchy of Programmable Devices

Where:PLD=Programmable Logic DeviceSPLD= Simple Programmable Logic DeviceCPLD= Complex Programmable Logic DevicePROM= Programmable Read Only MemoryPLA= Programmable Logic ArrayPAL= Programmable Array Logic

● PROM

Programmable Read Only Memories are simply memories that can be inexpensively programmed by the user to contain a specific pattern.

Page 14: report on linux or vhdl

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

The Programmable Logic Arrays provide a solution to the speed and input limitation of PROMs. Inputs are given to AND plane and then results are derived from OR plane which is explained diagrammatically in figure 4. Typically, inverters are provided at the inputs and outputs to provide logical NOT. PLA can implement a large number of functions i.e., all those which can be resolved in Sum Of Products (SOP) form. The interconnects between planes and through input and output are defined using programming. PLAs have more inputs and are faster as compared to PROM.

Figure 4: PLA Architecture

● PAL

Page 15: report on linux or vhdl

Programmable Array Logic comprises of a wide programmable AND plane with fixed OR plane. Basic logic devices such as multiplexers, exclusive ORs and latches have to be added separately to inputs and outputs whereas clocked elements such as flip flops are included. Therefore PAL can implement a large number of logical functions including clocked sequential logic needed for state machines. Since it has a fixed OR plane, the processing is extremely fast. The architecture of Programmable Array Logic is shown in figure 5.

Figure 5: PAL Architecture

● 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

Page 16: report on linux or vhdl

Figure 7: CPLD Architecture

● FPGAField 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).

Figure 8: A generic FPGA structure

Page 17: report on linux or vhdl

Figure 9: The key elements forming a simple programmable logic block

2. INTRODUCTION TO VHDLVHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware

Description Language. In the mid-1980's the U.S. Department of Defense and the IEEEsponsored 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.

VHDL is designed to fill a number of needs in the design process. It is being usedfor documentation, verification, and synthesis of large digital designs. Firstly, it allowsdescription of the structure of a design i.e. how it is decomposed into sub-designs, and how those sub-designs are interconnected. Secondly, it allows the specification of the function of designs using familiar programming language forms. Thirdly, as a result, it allows a design to be simulated before being manufactured so that designers can quickly compare alternatives and test for correctness without the delay and expense of hardware prototyping.

2.1 Need of VHDL

Page 18: report on linux or vhdl

Initially, in the late 1970's the circuit designers worked on Printed Circuit Boards,when there was no Hardware Description Language present in the market. Following were the limitations of PCB's :-

1. For the designing of large circuits we need a large PCB. Suppose if at that time theyhad to design a microprocessor then they needed a PCB size equal to the size of atypical college campus, which was not a feasible approach.

2. The testing of large circuits was not possible because the large circuits contain lots of gates and the response of each and every gate could not be checked. So, it was also not a feasible approach.

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.

The usage of VHDL is about 60% in the market as compared to verilog which isused in 40% applications only. Reason is the user-friendly nature of VHDL.

2.2 Advantages of VHDL

VHDL offers the following advantages:-Standard: VHDL is an IEEE standard. This reduces confusion and makes interfaces between tools, companies and products easier. Any development to the standard would have better chances of lasting longer and have less chance of becoming obsolete due to incompatibility with others.

Government Support: VHDL is a result of the VHSIC program; hence it is clear that the US government supports the VHDL standard for electronic procurement. The department of defense requires contractors to supply VHDL for all Application Specific Integrated Circuit (ASIC) designs.

Industry Support: With the advent of more powerful and efficient VHDL tools has come the growing support of the electronics industry. Companies use VHDL not only with regard to defense contracts, but also for their commercial designs.

Page 19: report on linux or vhdl

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.

Reusability: Certain common designs can be described, verified and modified slightly in VHDL for future use. This eliminates reading and marking changes to schematic pages, which is time-consuming and subject to error.

Technology and Foundry Independence: The functionality and behavior of the design can be described with VHDL and verified, making it foundry and technology independent. This frees the designer to proceed without having to wait for the foundry and technology to be selected.

2.3 Differences between VHDL and other Procedural Languages

VHDL is a parallel language while C/C++ are sequential languages. Each statement occuring in VHDL is executed concurrently i.e. all statements run simultaneously. In C/C++ each statement is executed in sequential order and its own turn. In VHDL, explicit constructs exist for explicit sequential steps.

VHDL is a strongly typed language. It doesn't allow any mismatching of types, though type conversion is permitted.

VHDL allows use of explicit time delay, which is not applicable in procedural language. In procedural languages, the right hand side value is assigned to the left hand side as soon as the statement is executed. In VHDL, we have an advantage that we can assign the computed value to a signal after time delay.

VHDL model cannot be implemented in real time application directly like other procedural languages. It is simulated and synthesized using in-built system clock.

Page 20: report on linux or vhdl

2.4 Capabilities of VHDL

● Implementation of any circuit idea like complete robot design. ● Microprocessor of your own configuration. ● Direct hardware interaction.

2.5 VHDL Terms

Library: Library is a collection of pre-defined keywords and components defined in it. Library contains all characteristics of all components.

Entity: A hardware abstraction of digital systems is called entity. All designs are expressed in entities.

Architecture: All entities that can be simulated have architecture description. The architecture describes the behavior of entity.

Package: A package is a collection of commonly used data types and subprograms used in a design. Package is just like a tool box that contains tools used to build designs.

Configuration: A configuration is used to bind a component instance to an entity architecture pair. A configuration is like parts list for a design.

Bus: The term bus is used to bind a group of signals at one position.

Generic: A generic is a VHDL term for a parameter that passes information to an entity.

Process: A process is a basic unit of execution in VHDL source code. All operations that are performed in a simulation of a VHDL description are broken into single or multiple processes.

2.6 Styles of Modeling1. Dataflow modeling2. Behavioral modeling

Page 21: report on linux or vhdl

3. Structural modeling

Dataflow Modeling: In the dataflow style of modeling, we have to know just about the boolean expressions and how data flows inside the program.

Behavioral Modeling: For programming in the behavioral style of modeling we have to know about the truth table and behavior of entities in the program.

Structural Modeling: The structural style of modeling comes into picture when we have to deal with the bigger projects. The big project is divided into small modules and we have to design each module separately. At the end of the project each module is added s the component in the main program, or in other words, all modules are interfaced with each other in the main program.

2.7 VHDL DESIGN FLOW Initial Design Entry

Logic Optimization

Technology Mapping

Placement

Routing

Programming Unit

Configured FPGA

2.8 Basic Structure of a VHDL file

A digital system in VHDL consists of a design entity that can contain other entities that are then considered components of the top-level entity. Each entity is modeled by an entity declaration and an architecture body. One can consider the entity declaration as the interface to the outside world that defines the input and output signals, while the architecture body contains the description of the entity

Page 22: report on linux or vhdl

and is composed of interconnected entities body contains the description of the entity and is composed of interconnected entities, processes and components, all operating concurrently, as schematically shown in Figure 2.1 below. In a typical design there will be many such entities connected together to perform the desired function.

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.

2.9 Expressions and Operators

Expressions in VHDL are much like expressions in other programming languages. An expression is a formula combining primaries with operators. Primaries include names of objects, literals function calls and parenthesized expressions.

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

Highest precedence: * * abs not * / mod rem + (sign) -(sign) + - & = /= < < = >>=

Lowest precedence: and or nand nor xor

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’

Page 23: report on linux or vhdl

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.

- - VHDL supports different classes of operators that operate on signals, variables and constants. The different classes of operators are summarized below.

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.

Page 24: report on linux or vhdl

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:

variable STS :Boolean;constant A : integer: 24; constant B_COUNT :integer:=32;constant C : integer:= 14;

STS <= (A >B_COUNT); - - will assign the value “TRUE” to STS

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”

type new_std_logic is (‘0’, ‘1’ ‘Z’, ‘-‘);

Page 25: report on linux or vhdl

variable A1: new_std_logic := ‘1’;variable A2: new_std_logic:=’Z’;

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

These operators perform a bit-wise shift or rotate operation on a one-dimensional array of elements of the type bit (or std_logic) or Boolean.

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,

Variable NUM1 :bit_vector:= “10010110”;NUM1 srl 2;

Will result in the number “00100101”.

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

The addition operators are used to perform arithmetic operation (addition and subtraction) on operands of any numeric type. The concatenation (&) operator is used to concatenate two vectors together to make a longer one. In order to use these operators one has to specify the ieee.std_logic_unsigned.all or std_logic_arith package in addition to the ieee.std_logic_1164 package.

An example of concatenation is the grouping of signals into a single bus [4].Signal MYBUS :std_logic_vector (15downto 0);

Page 26: report on linux or vhdl

Signal STATUS : std_logic_vector (2downto 0);Signal RW, CSI, CS2 : std_logic;Signal MDATA : std_logic_vector (0 to 9);MYBUS <= STATUS &RW&CS1&SC2&MDATA;MYARRAY (15 downto 0) <=”1111_1111” & MDATA (2 to 9);NEWWORD <=’ VHDL” & “93”;The first example results in filling up the first 8 leftmost bits of MYARRAY with 1’s and the rest with the 8 rightmost bits of MDATA. The last example results in an array of characters “VHDL93”

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 remainder (rem) and modulus (mod) are defined as follows:

A rem B – (A/B)*B (in which A/B in an integer)A mod B =A-B*N (in which N is an integer)

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.

Some examples of these operators are given below.

11 rem 4 results in 3 (-11) rem 4 results in-39 mod 4 results in 17 mod (-4) results in -1 (7-4*2=-1).

Page 27: report on linux or vhdl

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.

Delays or timing informationPackages (list standard, 1164 packages).

3. PROGRAMMING IN VHDL3.1 HALF ADDER

--Structural model for Half Adder

library IEEE;use IEEE.STD_LOGIC_1164.all;entity HA isport(A,B:in STD_LOGIC; Sum, Carry:out STD_LOGIC);end HA;architecture struct of HA iscomponent myXORport(in1,in2:in STD_LOGIC; out1:out STD_LOGIC);end component;beginX1: myXOR port map(A,B,Sum);Carry<=A and B;end struct;

Page 28: report on linux or vhdl

3.2 FULL ADDER

--Structural model for Full Adderlibrary IEEE;use IEEE.STD_LOGIC_1164.all;entity FA isport(x,y,cin:in std_logic; s, cout:out std_logic);end FA;architecture struct of FA issignal s1,c1,c2 :std_logic;component HAport(A,B:in STD_LOGIC; sum, Carry:out STD_LOGIC);end component;beginHA1: HA port map(x,y, s1,c1);HA2: HA port map(s1,cin, s,c2);cout<=c1 or c2;end struct;

--VHDL code for DATA FLOW model of Full Adder:library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity FA_DF isport(Fx, Fy, Fcin : in BIT; Fs, Fcout : out BIT);end FA_DF;architecture FA_dataflow of FA_DF isbeginFs <= Fx XOR Fy XOR Fcin;Fcout <= (Fx AND Fy) OR (Fx AND Fcin) OR (Fy AND Fcin);end FA_dataflow;

--VHDL code for BEHAVIORAL model of Full Adderlibrary IEEE;use IEEE.STD_LOGIC_1164.ALL;

Page 29: report on linux or vhdl

entity FA_Bhr isport(Fx, Fy, Fcin : in BIT; Fs, Fcout : out BIT);end FA_Bhr;architecture FA_struct of FA_Bhr iscomponent HAport (hx, hy :in BIT; hs, hcout: out BIT);end component;signal s1, c1, c2 : BIT;beginHA1: HA port map (Fx, Fy, s1, c1);HA2: HA port map (s1, Fcin, Fs, c2);Fcout <= c1 OR c2;end FA_struct;

3.3 4-BIT ADDER CUM SUBTRACTOR

VHDL CODE (Structural):LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;//standard library packagesENTITY addersub4s ISPORT(A,B:IN BIT_VECTOR(3 DOWNTO 0);

Page 30: report on linux or vhdl

SEL:IN BIT;COUT:OUT BIT;X:OUT BIT_VECTOR(3 DOWNTO 0));//inputs and outputs declarationEND addersub4s;ARCHITECTURE struc OF addersub4s ISCOMPONENT fa1dPORT(X,Y,CIN:IN BIT;S,COUT:OUT BIT);END COMPONENT;COMPONENT xor2 //basic components used for realization…PORT(A,B:IN BIT;C:OUT BIT);END COMPONENT;COMPONENT and2bitPORT(A,B:IN BIT;C:OUT BIT);END COMPONENT;COMPONENT invertPORT(A:IN BIT;B:OUT BIT);END COMPONENT;SIGNAL E:BIT_VECTOR(3 DOWNTO 0);SIGNAL C:BIT_VECTOR(3 DOWNTO 1);SIGNAL carry,non_sel:BIT;BEGIN//mapping with basic gatesX0:xor2 PORT MAP(B(0),SEL,E(0));FA0:fa1d PORT MAP(A(0),E(0),SEL,X(0),C(1));X1:xor2 PORT MAP(B(1),SEL,E(1));FA1:fa1d PORT MAP(A(1),E(1),C(1),X(1),C(2));X2:xor2 PORT MAP(B(2),SEL,E(2));FA2:fa1d PORT MAP(A(2),E(2),C(2),X(2),C(3));X3:xor2 PORT MAP(B(3),SEL,E(3));FA3:fa1d PORT MAP(A(3),E(3),C(3),X(3),carry);I0:invert PORT MAP(SEL,non_sel);A0:and2bit PORT MAP(non_sel,carry,COUT);END struc;

VHDL Code(Dataflow):LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY addersub4d ISPORT(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 ISBEGIN

Page 31: report on linux or vhdl

PROCESS(A,B,SEL)VARIABLE S:BIT_VECTOR(3 DOWNTO 0);VARIABLE C:BIT_VECTOR(4 DOWNTO 0);BEGINC(0):=SEL;FOR i IN 0 TO 3 LOOPS(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

Page 32: report on linux or vhdl

LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY dec24d ISPORT(A,B,EN_L:IN BIT;Q0,Q1,Q2,Q3:OUT BIT);END ENTITY;ARCHITECTURE dataflow OF dec24d ISBEGINQ0<=(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

Page 33: report on linux or vhdl

VHDL CODE: (behavioral code)LIBRARY IEEE;//standard library.USE IEEE.STD_LOGIC_1164.ALL;//importing standard library.USE IEEE.STD_LOGIC_ARITH.ALL;//entity declarationENTITY 4mux1 ISPORT(A,B,C,D:IN STD_LOGIC;S0,S1: IN STD_LOGIC;Q:OUT STD_LOGIC);END 4mux1;//end of entity declarationARCHITECTURE behave OF 4mux1 ISBEGINPROCESS(A,B,C,D,S0,S1)//sensitivity list.BEGINIF 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

Page 34: report on linux or vhdl

VHDL CODE:LIBRARY IEEE;//standard libraryUSE IEEE.STD_LOGIC_1164.ALL;//importing the libraray//entity declaration...ENTITY decoder38 ISPORT(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 ISPORT(S0,S1,EN_L:IN BIT;Q0,Q1,Q2,Q3:OUT BIT);END COMPONENT;COMPONENT INVERTPORT(A:IN BIT;B:OUT BIT);END COMPONENT;//signal declaration..SIGNAL CINV:BIT;BEGINI0:INVERT PORT MAP(C,CINV);D0:decoder24 PORT MAP(A,B,C,Q0,Q1,Q2,Q3);

Page 35: report on linux or vhdl

D1:decoder24 PORT MAP(A,B,CINV,Q4,Q5,Q6,Q7);END struc;//

3.7 D FLIP FLOP

VHDL CODELIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY ffD ISPORT(D,CLK,RESET:IN BIT;Q,QINV:OUT BIT);END ffD;ARCHITECTURE behav OF ffD ISBEGINPROCESSBEGINWAIT 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;

Page 36: report on linux or vhdl

4. COMPONENTS USED IN THE DESIGN4.1 Resistors

Resistors are components that have a predetermined resistance. Resistance determines how much current will flow through a component. Resistors are used to control voltages and currents. A very high resistance allows very little current to flow. Air has very high resistance. Current almost never flows through air. (Sparks and lightning are brief displays of current flow through air. The light is created as the current burns parts of the air.) A low resistance allows a large amount of current to flow. Metals have very low resistance. That is why wires are made of metal. They allow current to flow from one point to another point without any resistance. Wires are usually covered with rubber or plastic. This keeps the wires from coming in contact with other wires and creating short circuits. High voltage power lines are covered with thick layers of plastic to make them safe, but they become very dangerous when the line breaks and the wire is exposed and is no longer separated from other things by insulation.

Resistance is given in units of ohms. (Ohms are named after Mho Ohms who played with electricity as a young boy in Germany.) Common resistor values are from 100 ohms to 100,000 ohms. Each resistor is marked with colored stripes to indicate its resistance.

4.2 Variable Resistors

Variable resistors are also common components. They have a dial or a knob that allows you to change the resistance. This is very useful for many situations. Volume controls are variable resistors. When you change the volume you are changing the resistance which changes the current. Making the resistance higher will let less current flow so the volume goes down. Making the resistance lower will let more current flow so the volume goes up. The value of a variable resistor is given as its highest resistance value. For example, a 500 ohm variable resistor can have a resistance of anywhere between 0 ohms and 500 ohms. A variable resistor may also be called a potentiometer (pot for short).

Page 37: report on linux or vhdl

4.3 Capacitors

Capacitors are like electron storage banks. If your circuit is running low, it will deliver electrons to your circuit. Some capacitors are polarized, meaning current can only flow one direction through them. If a capacitor has a lead that is longer than the other, assume the longer lead must always connect to positive.

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

Switches are devices that create a short circuit or an open circuit depending on the position of the switch. For a light switch, ON means short circuit (current flows through the switch, and lights light up.) When the switch is OFF, that means there is an open circuit (no current flows, lights go out. When the switch is ON it looks and acts like a wire. When the switch is OFF there is no connection.

4.6 Transistor

Transistors are basic components in all of today's electronics. The transistor has three legs, the Collector (C), Base (B), and Emitter (E). Sometimes they are labeled on the flat side of the transistor. Transistors always have one round side and one flat side. If the round side is facing you, the Collector leg is on the left, the Base leg is in the middle, and the Emitter leg is on the right.

Page 38: report on linux or vhdl

4.7 Relays

A relay is usually an electromechanical device that is actuated by an electrical current. The current flowing in one circuit causes the opening or closing of another circuit Relays are like remote control switches and are used in many applications because of their relative simplicity, long life, and proven high reliability. They are used in a wide variety of applications throughout industry, such as in telephone exchanges, digital computers and automation systems.

4.8 Power Supply

Power supply can be defined as electronic equipment, which is a stable source of D.C. power for electronic circuits.

Power supply can be classified into two major categories: - 1 Unregulated power supply 2 Regulated power supply

UNREGULATED POWER SUPPLY:-These power supplies, supply power to the load but do not take into

variation of power supply output voltage or current with respect to the change in A.C. mains voltage, load current or temperature variations. In other words, we can say that the output voltage or current of an unregulated power supply changes with the change in A.C.mains voltage, load current and temperature.

REGULATED POWER SUPPLY:-These power supplies are regulated over the change in source voltage

or load current i.e. its output remain stable.

Regulated power supplies are of two types: -1 Current regulated power supplies

These are constant current supplies in spite of change in load or input voltage.

2 Voltage regulated power supplies These supplies supply constant output voltage with respect to the variation in load or source input voltage.

Page 39: report on linux or vhdl

CIRCUIT OF REGULATED POWER SUPPLY WITH HALF WAVE RECTIFIER AND IC-7809 AS A REGULATOR:-

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.

4.9 Printed Circuit Boards

The use of miniaturization and sub miniaturization in electronic equipment designhas been responsible for the introduction of a new technique in inter component wiring and assembly that is popularly known as printed circuit.

The printed circuit boards (PCBs) consist of an insulating substrate material with metallic circuitry photo chemically formed upon that substrate. Thus PCB provides sufficient mechanical support and necessary electrical connections for an electronic circuit.

Advantages of printed circuit boards: -1) Circuit characteristics can be maintained without introducing

variations inter . circuit capacitance .

Page 40: report on linux or vhdl

2) Wave soldering or vapour phase reflow soldering can mechanize component wiring and assembly.

3) Mass production can be achieved at lower cost.4)The size of component assembly can be reduced with corresponding

decrease in weight.

5) Inspection time is reduced as probability of error is eliminated.

Types of PCB’s: -

There are four major types of PCB’s: - Single sided PCB : - In this, copper tracks are on one side of the board,

and are the simplest form of PCB. These are simplest to manufacture thus have low production cost.

Double sided PCB :- In this, copper tracks are provided on both sides of the substrate. To achieve the connections between the boards, hole plating is done, which increase the manufacturing complexity.

Multilayered PCB : - In this, two or more pieces of dielectric substrate material with circuitry formed upon them are stacked up and bonded together. Electrically connections are established from one side to the other and to the layer circuitry by drilled holes, which are subsequently plated through copper.

Flexible PCB : - Flexible circuit is basically a highly flexible variant of the conventional rigid printed circuit board theme.

PCB Manufacturing Process: -There are a number of different processes, which are used to

manufacture a PCB, which is ready for component assembly, from a copper clad base material. These processes are as follows

Preprocessing : - This consists of initial preparation of a copper clad laminate ready for subsequent processing. Next is to drill tooling holes. Passing a board through rollers performs cleaning operation.

Photolithography : - This process for PCBs involves the exposure of a photo resist material to light through a mask. This is used for defining copper track and land patterns.

Etching : - The etching process is performed by exposing the surface of the board to an etchant solution which dissolves away the exposed copper areas .The different solutions used are: FeCl3, CuCl3, etc.

Drilling : - Drilling is used to create the component lead holes and through holes in a PCB .The drilling can be done before or after the track areas have been defined.

Page 41: report on linux or vhdl

Solder Masking : - It is the process of applying organic coatings selectively to those areas where no solder wettings is needed .The solder mask is applied by screenprinting.

Metal Plating : - The plating is done to ensure protection of the copper tracks and establish connection between different layers of multilayer boards. PCBs are stacked before being taken for final assembly of components .The PCB should retain its solder ability.

Bare-Board Testing : - Each board needs to ensure that the required connections exist, that there are no short circuits and holes are properly placed .The testing usually consists of visual inspection and continuity testing.

4.10 Entry Level Tool II Kit

The Entry Level Tool - II is a MAX II CPLD (EPM240/570) based board which serves as the basic tool for understanding and experimenting with Programmable Logic Devices, namely the MAX II Family, and hence the name Entry Level Tool - II or ELT-II for short. The ELT-II Board helps in understanding the basic Programmable Logic Design flow in the simplest manner. This board contains a number of user IOs for easy access and experimentation.

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:-

Page 42: report on linux or vhdl

ELT II BOARD- TOP VIEW

BOARD COMPONENTS

Page 43: report on linux or vhdl

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.

5. EXPERIENCE DURING TRAININGPractical training provides a great learning experience with regard to

implementation of theoretical knowledge in real-world applications. Furthermore, a course in VLSI/VHDL based systems gave us additional knowledge on how these techniques are implemented since our University

Page 44: report on linux or vhdl

curriculum imbibes only basics of CMOS IC fabrication and not its implementation in VLSI circuit design.

During training, we underwent a basic course on VLSI technology as it is prevalent in the world market. We also learnt basic VHDL programming and attended lectures on basic electronics and digital electronics, which are indispensable for Electronics Engineering students.

We were a team of six students, having a hands-on experience on technology, we also learnt working in a team and creating a congenial environment for higher efficiency as a human resource.

6. SUGGESTIONS FOR IMPROVEMENT&

IMPLEMENTATION FOR STUDENTS

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.

Page 45: report on linux or vhdl

7. BIBLIOGRAPHY1. 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).