Student, 2,3 Assistant Professor, Arya Institute of Engineering & Technology, Jaipur, INDIA Abstract—the inquisitiveness to present this paper arises after making projects on microcont
Trang 1International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com ( ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 3, Issue 3, March 2013)
161
Digital Embedded Design:A Comparative Analysis on
Methodoligies
Jai Gidwani1, Pranay Lahoty2,Vidhi Vart Chandrodaya3, Gaurav Kumar Sharma4
1,4
B.Tech Student, 2,3 Assistant Professor, Arya Institute of Engineering & Technology, Jaipur, INDIA
Abstract—the inquisitiveness to present this paper arises
after making projects on microcontroller, FPGA and CPLD in
trainings This paper will clear the architectural and
programming differences between them The microcontrollers
are computers in an IC while FPGA comprises logical blocks
only that can be rewired with software tools CPLD has
architectural features of both PAL and FPGA, but it has less
complexity than FPGA The knowledge of hardware circuits is
needed to implement VHDL programs but a algorithm
approach is sufficient to write a code in C
Keywords—ASM, FPGA, HDL, Microcontroller, UCF
I INTRODUCTION
The word „digital‟ is used for the systems operating on
discrete values [1] Converting the real world information
into these discrete values is the main idea used in all digital
systems The entry of microprocessor and embedded system
in the 1970‟s changed the concept of „control‟ Embedded
systems are dedicated to specific tasks (not stand alone like
a personal computer) The number of transistors that can be
designed on silicon wafer are increasing and realizing
complex functions on them is not a daunting task And
hence the cost per unit is decreasing The concept of
programmable logic came by combining gates and
flip-flops Gate array is the basic component used in VLSI It is
the repetition of pattern of gates fabricated in area of silicon
Interconnection between these gate arrays is done according
the requirement This paper will cover the various aspects of
microcontroller, FPGA and CPLD
The first commercial FPGA was launched in 1985 The
computer based tools in mid 1980‟s has transformed
electronic industry worldwide By changing the program in
a programmable device, the same hardware can be used for
many applications After that, commercialization of
development boards started Digital designers are diverting
their attention from microcontroller to FPGA But it is not
appropriate to state that FPGA will rule over
microcontroller due to its complex pin configuration and
synthesis tools used for it The paper is intended to throw
light on their internal architectures and the available tools to
configure them
II MICROCONTROLLER AND FPGA
A microcontroller is a computing system The structure
of microcontroller is compatible to a simple computer placed in a single chip with all necessary components like memory and timing inside It is programmed to do simple task for other hardware It has lots of hierarchical rules and commands over its input and output It has its own processing unit It can perform loops, execute timed instructions, and process calculations like a small PC under program control
FPGA, the first thing which creates problems into mind is related with acronym‟s meaning i.e field programmable gate array or field gate programmable area Hence they are a matrix of logic gates which can be programmed (or better said reprogrammed) in any way to suits the needs of the application With the help of flip-flop and a logic gate any digital circuit can be designed This is how they work They are programmable logic means the hardware configuration may change according to the application
This is the first basic difference that microcontroller cannot be rewired It stuck to the configuration that the supplier provides But the FPGA, on the other hand, do not stick to any hardware configuration [2]
The next difference is in terms of program execution On FPGA code is executed concurrently [in parallel] and on MCU‟s the code written in C is transformed into machine code via a compile-linking process and then executed step
by step by the processor
Parallel calculation and increased execution speed made FPGA quite useless in application where power consumption is critical For example they will never replace ARMs in the Smartphone
FPGA is only an array of gate that can be connected as the user wishes That does not mean the user has to define switch connections individually It is done using software It will translate HDL‟s code and then places and routes the translated design Some circuits are already made in libraries and optimized for speed or area It is not computing system FPGA‟s are used for relatively simpler operations but higher processing speeds in comparison to microcontrollers [3]
Trang 2International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com ( ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 3, Issue 3, March 2013)
162
The greatest advantage that FPGA bring into play is that
they can host completely different and independent digital
systems executing, in parallel of course, absolutely non
related tasks But the power consumption and cost of FPGA
dominate its incredible flexibility and above discussed
advantages
In case of MCU‟s the hardware is pre-decided at
fabrication The hardware consists of a CPU, a program
memory and a data memory There is always explicit
separation between data path and program memory All
commands are read from program memory and executed
sequentially Also number of modules, called on-chip
peripherals as timers and communication interfaces are
integrated [4]
In case of FPGA the hardware is programmable A high
number of programmable logic blocks is available which
can be individually connected by programmable
interconnect matrices Execution is of parallel nature, but
sequential behavior can be realized through the use of state
matrices, control/enable signals and pipelining
The processor could also be integrated into FPGA‟s so
called soft processors [5]
The microcontroller as stated is a sequential logic
machine that requires a program counter to execute a next
instruction (indeterminate timing), the FPGA has no
program counter and instructions processed simultaneously
(determinate timing) The fact that there is no sequential
program counter make FPGA less vulnerable to missed
instruction more commonly associated with
microcontroller
III FPGAAND CPLD
An FPGA is an IC designed to configured after
manufacturing, hence it is called field programmable
FPGA‟s contain programmable logic components termed as
“logic blocks” and hierarchy of reconfigurable interconnects
that allows the blocks to be wired together [6]
The primary difference between CPLD and FPGA are
architectural A CPLD has restrictive structure which results
in less flexibility The FPGA architecture is dominated by
interconnects which makes them not only far more flexible
but also far more complex to design The one more major
difference between architecture of CPLD and FPGA device
is that FPGA‟s are internally based on look up
tables(LUT‟s) and CPLD„s form the logic functions with
sea of gates K input LUT can implement any K input 1
output logic functions [7, 8]
Figure1 FPGA Architecture [9]
CPLD has architectural feature of both PAL and FPGA but less complex than FPGA Macro cell is the building block of CPLD A macro cell on most modern CPLD‟s contains a SOP combinational logic function and an optional flip-flop
Figure 2.CPLD Architecture [9]
Configurable Logic Blocks (CLB‟s) is the logical unit of FPGA FPGA have latches available in their CLB‟s to store the input data FPGA‟s are “fine grained” devices that mean they contain a lot (up to 100000) of tiny blocks of logic with flip- flops CPLD‟s are coarse-grained devices- they contain relatively few (a few 100‟s) large blocks of logic with flip-flops
We can build large digital designs on FPGA while CPLD can contain small designs only
FPGA‟s lose their functionality when the power goes away (like RAM in the computer that loses its content) [9] CPLD is typically a device that retains its configuration once programmed
Trang 3International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com ( ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 3, Issue 3, March 2013)
163
IV IMPLEMENTATION [10-15]
We have implemented some projects on both FPGA and
microcontroller as well Here is a description of blinking of
LED‟s A variety of available tools are available to
accomplish the design entry step for FPGA Some
designers prefer to use their favorite schematic entry
package while others prefer to specify their design using a
hardware description language such as Verilog, VHDL, or
ABEL For programming FPGA‟s we have learnt VHDL
(Very High Speed Integrated Circuit Hardware Description
Language) This language has the biggest advantage that it
allows the modeling of the digitals system (description) and
verification before translating it to real hardware The pre
testing of IC is done using VHDL The language supports
9-valued logic(U,X,0,1,Z,W,H,L,-), while in case of
assembly or C, the designer is only capable of sending or
receiving „1‟ or „0‟ to the pins of microcontroller The
VHDL code for blinking of LED‟s with time interval of
one second look like-
Process (clk1, cnt)
Begin
If (clk1'event and clk1='1') then
cnt <= cnt + 1;
If ( cnt = 5000000 ) then 1Hz from 10 MHz
clk_tmp <= not clk_tmp;
cnt <= 0;
End if;
End if;
End process;
clk2 <= clk_tmp ;
Process (clk2)
Variable m: integer: =0;
Begin
If (rising_edge(clk2))then
m:=m+1;
If (m=1) then
Led (0) <='1';
Led (1) <='1';
End if;
If (m=2) then
Led (0) <='0';
Led (1) <='0';
End if;
If (m>=2) then
m:=0;
End if;
End Process;
The above program uses clock division and then blinks
two LED‟s together
After writing code for it, the next step is to write a UCF (User Constraints File) in which the pin details of various inputs and outputs is mentioned The choices are more here compared to microcontroller And then generate a programming file Finally a bit or XSVF (Xilinx serial Vector Format) file is transformed to a target device Next let‟s consider the same case with microcontroller programming in assembly language In this case generating
a „hex‟ file from „asm‟ file is a bit easier than generating a
„bit‟ or XSVF file The subroutine is designed to give a delay of a second and written at the end of the program The subroutine is doing nothing but eating machine cycles
to generate a delay in microcontroller It is designed for the oscillator‟s frequency 11.0592 MHz
$mod52 Org 0000h main:clr p1.0 clr p1.1 acall delay sjmp main delay:mov r0,#07h main1:mov r1,#0ffh main2:mov r2,#0ffh main3:djnz r2,main3
djnz r1,main2;
djnz r0,main1;
ret end
V RESULT
The output of both the programs is same But that does not imply that one can replace other In fact apart from their set of languages their set of applications are also different due to the differences mentioned above For example logic functions namely AND gate can be implemented by a single statement in VHDL as:
c<=a and b;
But in case of assembly or C used for microcontroller we have to create a logic that „c‟ gets the value 1 when both „a‟ and „b‟ are 1 A pure logical or algorithm thinking is required to write a program in C But a successful VHDL programmer requires the knowledge of hardware circuits and should be able to predict how a given code will be implemented in hardware If synthesis tools of FPGA will
be improved, then FPGA can replace microcontroller For this task, the change of FPGA architecture is needed because they are flexible but very difficult to configure
Trang 4International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com ( ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 3, Issue 3, March 2013)
164
VI CONCLUSIONS
Microcontrollers are custom built mini computers in an
IC while FPGA‟s are composed of logical blocks that can
be rewired electrically Microcontroller consumes less
power than FPGA FPGA take considerably longer time to
set up while there are ready built microcontrollers being
sold for specific uses Building devices with FPGA are
more costly than microcontroller There is no need to stick
with one technology In most cases, the choice depends on
a complex combination of factors and no single technology
is perfect Different technology mixes according to the
requirement of digital design are most appropriate at
different stages of lifecycle The part played by FPGA in
context of embedded system is expanding day by day It is
due to the reason that capability of FPGA is on the rise and
now powerful FPGA design software are also available In
current years FPGA is finding its applications for fast
signal processing also
Acknowledgement
We want to deliver our sincere thanks to management of
Arya Institute of Engineering and Technology for
supporting and providing the facilities to carry out project
work in embedded systems, robotics and VHDL which is
presented in the form of this paper
REFERENCES
[1] M Morris Mano,” Digital Design(4 th edition)”, Prentice Hall [2] E.A Bazzerra and M.P Gough A Guide to Migrating From Microprocessor to FPGA coping with support tool limitations.2007 [3] Z Salcic, PROTOS microprocessor/FPGA-based prototyping system for embedded applications, Microprocessor and Microsystems, 21,
1997
[4] pressexposure.com/FPGA_vs_CPLD_vs_Microcontroller-142920.html
[5] Falk Salewski and Adam Taylor Fault Handling in FPGA and Microcontroller in Safety-Critical Embedded Applications: A Comparative Study June 1999
[6] J O Hamblen, Rapid prototyping using field programmable logic devices, IEEE Micro, 20(3), 2000
[7] Philip A, Simpson, “FPGA Design”, Springer
[8] Ian Kuon, Russel Tessier,Jonathan Rose, ”FPGA Architecture: Survey and Challenges”, Now Publishers Inc
[9] www.fpga-site.com/faq.html
[10] Jayaram Bhasker, ”A VHDL Primer”, Prentice Hall
[11] Douglas Perry,” VHDL: Programming By Example”, Mcgraw-Hill Education
[12] Muhammad Ali Mazidi, Janice Gillispe Mazidi,”The 8051 Microcontroller and Embedded Systems”, Prentice Hall
[13] B Martin-Del-Brio and C Bernal-Ruiz, A software tool for teaching microcontroller system principles, Int J Electrical Eng Educ., 36(4), 1999
[14] J W Valvano, Embedded Microcomputer Systems Real Time Interfacing, Brooks/Cole Thomson Learning (2000)
[15] Xilinx, Synthesis and Simulation Design Guide, Xilinx,
1998