SlideShare a Scribd company logo
FPGA-Based Design and Implementation of the
Greatest Common Divisor using
Presented by: Ibrahim Hazmi
Supervised by: Dr. Mihai Sim
iHaz 20142
Design 16-bit GCD (the Greatest Common Divisor) and
Implement it on Xilinx Spartan6 FPGA.
It is challenging is to design such circuit and examine the
area-speed tradeoff in order to get the result at reasonable
speed with optimal utilization of the FPGA resources.
So, the design came in different Levels:
High Behavioural Level
ASM Behavioural Level
Direct Structural Level
Optimized Structural Level
Design Problem & Motives
iHaz 20143
Overview of Xilinx Spartan6 FPGA
Overview of the GCD
Euclidean Algorithm
Behavioural Level Design
High Level (While/For Loop)
ASM Level (ASM —> FSM)
Structural Level Design
Direct Structural (Data-path + FSM)
Optimized Structural Design (SAD)
Conclusion
Summary & Future Work
Outline
iHaz 20144
Xilinx Spartan6 (Overview)
PlanAhead
XC6SLX25
iHaz 20144
Xilinx Spartan6 (Overview)
PlanAhead
XC6SLX25
iHaz 20144
Xilinx Spartan6 (Overview)
PlanAhead
Device
Logic

Cells
CLB
DSP
SlicesSlices FFs Max RAM LUT6
XC6SLX25 24,051 3,758 30,046 229 15,032 38
XC6SLX25
iHaz 20145
Greatest Common Divisor (GCD)
Greatest Common Factors (GCF)
Greatest Common Measure (GCM)
Highest Common Divisor (HCD)
Highest Common Factor (HCF)
What is GCD ?
36, 54
Euclidean Algorithm ?
Actually, It has many names:
iHaz 20146
36, 54
A B
N
Y
Euclidean Algorithm
iHaz 20146
36, 54
A B
N
Y
Euclidean Algorithm
A B
iHaz 20147
36, 54
A B
Euclidean Algorithm
iHaz 20148
36, 54
A B
36 54
Euclidean Algorithm
iHaz 20149
36, 54
A B
A = 36
Euclidean Algorithm
36 54
iHaz 20149
36, 54
A B
A = 36
Euclidean Algorithm
36 54
B = 18
iHaz 201410
36, 54
A B
Euclidean Algorithm
B = 18
36 18
iHaz 201411
36, 54
A B
Euclidean Algorithm
B = 18
A = 18
36 18
iHaz 201412
36, 54
A B
36 54
Euclidean Algorithm
36 18
GCD = 18
18 18
iHaz 201412
36, 54
A B
36 54
Euclidean Algorithm
36 18
GCD = 18
18 18
iHaz 201413
Behavioural Model (Loop)
A B
iHaz 201413
Behavioural Model (Loop)
A B
iHaz 201413
Behavioural Model (Loop)
A B
iHaz 201414
For Loop (Simulation)
Post-Route Simulation
Behavioural Simulation
Behavioural Simulation
Post-Route Simulation
iHaz 201414
For Loop (Simulation)
Post-Route Simulation
Behavioural Simulation
Behavioural Simulation
Post-Route Simulation
iHaz 201414
For Loop (Simulation)
Post-Route Simulation
Behavioural Simulation
Behavioural Simulation
Post-Route Simulation
iHaz 201415
For Loop (RTL, Implementation)
iHaz 201415
For Loop (RTL, Implementation)
Device # # Bits Note
# Adders/Subtractors 198 16 -
# Registers 0 - -
# Comparators 200 16 "100= & 99<”
# Multiplexers 298 16 2-1
# FSM 0 - -
# DSP 0 - -
# XOR 0 - -
Time Delay 478
# out of %
# Slices 2748 3758 73
# LUTs 8776 15032 58
# MUXCYs 4760 7516 63
# Registers 0 30064 0
iHaz 201416
Register Transfer Model (SM)
A B
iHaz 201416
Register Transfer Model (SM)
A B
iHaz 201417
ASM (Code Sample)
iHaz 201418
ASM (Implementation)
iHaz 201418
ASM (Implementation)
iHaz 201418
ASM (Implementation)
Device # # Bits Note
# Adders/Subtractors 2 16
# Registers 32 1 FF
# Comparators 2 16 "= & <”
# Multiplexers 14 16 (8,1), 1(5) 2-1(13), 3-1(1)
# FSM 1 - -
# DSP 0 - -
# XOR 0 - -
Time Delay 20.7
# out of %
# Slices 36 3758 1
# LUTs 98 15032 1
# MUXCYs 48 7516 1
# Registers 34 30064 1
iHaz 201419
Direct Structural Level
A B
iHaz 201419
Direct Structural Level
A B
iHaz 201420
Dir. Structural (Implementation)
iHaz 201420
Dir. Structural (Implementation)
iHaz 201420
Dir. Structural (Implementation)
Device # # Bits Note
# Adders/Subtractors 2 16 Sub/Accum.
# Registers 2 16 32 FF
# Comparators 2 16 "= & <”
# Multiplexers 11 2 (16), 9 (1) 2-1
# FSM 1 - -
# DSP 0 - -
# XOR 0 - -
Time Delay 15.5
# out of %
# Slices 30 3758 1
# LUTs 85 15032 1
# MUXCYs 52 7516 1
# Registers 34 30064 1
iHaz 201421
Optimized Structural Level
iHaz 201421
Optimized Structural Level
iHaz 201422
Opt. Str. (Code Sample)
iHaz 201422
Opt. Str. (Code Sample)
iHaz 201423
Opt. Structural (Implementation)
iHaz 201423
Opt. Structural (Implementation)
iHaz 201423
Opt. Structural (Implementation)
Device # # Bits Note
# Adders/Subtractors 1 16 Carry in
# Registers 2 16 32 FF
# Comparators 0
# Multiplexers 7 2 (16), 5 (1) 2-1
# FSM 1
# DSP 0
# XOR 33 1 (16), 32 (1)
Time Delay 23.6
# out of %
# Slices 33 3758 1
# LUTs 110 15032 1
# MUXCYs 16 7516 1
# Registers 34 30064 1
iHaz 201424
Summary
Device 4Loop ASM 2Sub SADGCD
# Adders/Subtractors 198 2 2 1
# Registers 0 32 2 2
# Comparators 200 2 2 0
# Multiplexers 298 14 11 7
# FSM 0 1 1 1
# DSP 0 0 0 0
# XOR 0 0 0 33
Time Delay 478 20.7 15.5 23.6
out of 4Loop % ASM 2Sub SADGCD
# Slices 3758 2748 73 36 30 33
# LUTs 15032 8776 58 98 85 110
# MUXCYs 7516 4760 63 48 52 16
# Registers 30064 0 0 34 34 34
iHaz 201425
Conclusion & Future Work
The Design of 16-bit GCD and its Implementation it on
Xilinx Spartan6 FPGA was demonstrated.
The area-speed tradeoff has been shown in different
Levels:
High Behavioural Level
ASM Behavioural Level
Direct Structural Level
Optimized Structural Level
Future Work: Primitives + Check new FPGAs where GCD
might be implemented inside a DSP
iHaz 201426
https://www.youtube.com/watch?v=DMSaYhD1GkM
http://esd.cs.ucr.edu/labs/tutorial/
http://en.wikipedia.org/wiki/Greatest_common_divisor
And many others
Spartan-6 FPGA Configurable Logic Block
User Guide (UG384 (v1.1) February 23, 2010)
References
iHaz 201427
Thank You

More Related Content

What's hot

Field Programmable Gate Array: Building Blocks and Interconnections
Field Programmable Gate Array: Building Blocks and InterconnectionsField Programmable Gate Array: Building Blocks and Interconnections
Field Programmable Gate Array: Building Blocks and Interconnections
Dr. Saravanakumar Umathurai
 
An introduction to FPGAs and Their MPSOCs
An introduction to FPGAs and Their MPSOCs  An introduction to FPGAs and Their MPSOCs
An introduction to FPGAs and Their MPSOCs
Mohammad Reza Khalifeh Mahmoodi
 
CPLDs
CPLDsCPLDs
RISC-V growth and successes in technology and industry - embedded world 2021
RISC-V growth and successes in technology and industry - embedded world 2021RISC-V growth and successes in technology and industry - embedded world 2021
RISC-V growth and successes in technology and industry - embedded world 2021
RISC-V International
 
SoC FPGA Technology
SoC FPGA TechnologySoC FPGA Technology
SoC FPGA Technology
Siraj Muhammad
 
Fpga computing
Fpga computingFpga computing
Fpga computing
rinnocente
 
RISC-V NOEL-V - A new high performance RISC-V Processor Family
RISC-V NOEL-V - A new high performance RISC-V Processor FamilyRISC-V NOEL-V - A new high performance RISC-V Processor Family
RISC-V NOEL-V - A new high performance RISC-V Processor Family
RISC-V International
 
FPGA
FPGAFPGA
ARM Architecture in Details
ARM Architecture in Details ARM Architecture in Details
ARM Architecture in Details
GlobalLogic Ukraine
 
Andes RISC-V processor solutions
Andes RISC-V processor solutionsAndes RISC-V processor solutions
Andes RISC-V processor solutions
RISC-V International
 
FPGA Introduction
FPGA IntroductionFPGA Introduction
FPGA Introduction
Kamlesh Kumar
 
Fpga &;cpld(by alok singh)
Fpga &;cpld(by alok singh)Fpga &;cpld(by alok singh)
Fpga &;cpld(by alok singh)
Alok Singh
 
Programmable Logic Devices Plds
Programmable Logic Devices PldsProgrammable Logic Devices Plds
Programmable Logic Devices Plds
Gaditek
 
RISC-V Zce Extension
RISC-V Zce ExtensionRISC-V Zce Extension
RISC-V Zce Extension
RISC-V International
 
Fpga optimus main_print
Fpga optimus  main_printFpga optimus  main_print
Fpga optimus main_printSushant Burde
 
An open flow for dn ns on ultra low-power RISC-V cores
An open flow for dn ns on ultra low-power RISC-V coresAn open flow for dn ns on ultra low-power RISC-V cores
An open flow for dn ns on ultra low-power RISC-V cores
RISC-V International
 
CPLDs
CPLDsCPLDs
CPLD & FPLD
CPLD & FPLDCPLD & FPLD
CPLD & FPLD
Abhilash Nair
 

What's hot (20)

Session 2,3 FPGAs
Session 2,3 FPGAsSession 2,3 FPGAs
Session 2,3 FPGAs
 
Field Programmable Gate Array: Building Blocks and Interconnections
Field Programmable Gate Array: Building Blocks and InterconnectionsField Programmable Gate Array: Building Blocks and Interconnections
Field Programmable Gate Array: Building Blocks and Interconnections
 
Fpga technology
Fpga technologyFpga technology
Fpga technology
 
An introduction to FPGAs and Their MPSOCs
An introduction to FPGAs and Their MPSOCs  An introduction to FPGAs and Their MPSOCs
An introduction to FPGAs and Their MPSOCs
 
CPLDs
CPLDsCPLDs
CPLDs
 
RISC-V growth and successes in technology and industry - embedded world 2021
RISC-V growth and successes in technology and industry - embedded world 2021RISC-V growth and successes in technology and industry - embedded world 2021
RISC-V growth and successes in technology and industry - embedded world 2021
 
SoC FPGA Technology
SoC FPGA TechnologySoC FPGA Technology
SoC FPGA Technology
 
Fpga computing
Fpga computingFpga computing
Fpga computing
 
RISC-V NOEL-V - A new high performance RISC-V Processor Family
RISC-V NOEL-V - A new high performance RISC-V Processor FamilyRISC-V NOEL-V - A new high performance RISC-V Processor Family
RISC-V NOEL-V - A new high performance RISC-V Processor Family
 
FPGA
FPGAFPGA
FPGA
 
ARM Architecture in Details
ARM Architecture in Details ARM Architecture in Details
ARM Architecture in Details
 
Andes RISC-V processor solutions
Andes RISC-V processor solutionsAndes RISC-V processor solutions
Andes RISC-V processor solutions
 
FPGA Introduction
FPGA IntroductionFPGA Introduction
FPGA Introduction
 
Fpga &;cpld(by alok singh)
Fpga &;cpld(by alok singh)Fpga &;cpld(by alok singh)
Fpga &;cpld(by alok singh)
 
Programmable Logic Devices Plds
Programmable Logic Devices PldsProgrammable Logic Devices Plds
Programmable Logic Devices Plds
 
RISC-V Zce Extension
RISC-V Zce ExtensionRISC-V Zce Extension
RISC-V Zce Extension
 
Fpga optimus main_print
Fpga optimus  main_printFpga optimus  main_print
Fpga optimus main_print
 
An open flow for dn ns on ultra low-power RISC-V cores
An open flow for dn ns on ultra low-power RISC-V coresAn open flow for dn ns on ultra low-power RISC-V cores
An open flow for dn ns on ultra low-power RISC-V cores
 
CPLDs
CPLDsCPLDs
CPLDs
 
CPLD & FPLD
CPLD & FPLDCPLD & FPLD
CPLD & FPLD
 

Viewers also liked

GCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignEGCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignEIbrahim Hejab
 
ProjectResearchReport2009
ProjectResearchReport2009ProjectResearchReport2009
ProjectResearchReport2009Ibrahim Hejab
 
PACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHazPACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHazIbrahim Hejab
 

Viewers also liked (6)

GCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignEGCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignE
 
Mawheb7
Mawheb7Mawheb7
Mawheb7
 
Mawheb6
Mawheb6Mawheb6
Mawheb6
 
ProjectResearchReport2009
ProjectResearchReport2009ProjectResearchReport2009
ProjectResearchReport2009
 
ResearchProject2009
ResearchProject2009ResearchProject2009
ResearchProject2009
 
PACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHazPACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHaz
 

Similar to FPGA_BasedGCD

Arm architecture
Arm architectureArm architecture
Synopsys User Group Presentation
Synopsys User Group PresentationSynopsys User Group Presentation
Synopsys User Group Presentation
emlawgr
 
Hari Krishna Vetsa Resume
Hari Krishna Vetsa ResumeHari Krishna Vetsa Resume
Hari Krishna Vetsa ResumeHari Krishna
 
Ambit Brochure Embedded Robotics 2023.pdf
Ambit Brochure Embedded Robotics 2023.pdfAmbit Brochure Embedded Robotics 2023.pdf
Ambit Brochure Embedded Robotics 2023.pdf
RintuKurian3
 
4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow
Maurizio Donna
 
Arm architecture overview
Arm architecture overviewArm architecture overview
Arm architecture overview
Sathish Arumugasamy
 
Crypto Performance on ARM Cortex-M Processors
Crypto Performance on ARM Cortex-M ProcessorsCrypto Performance on ARM Cortex-M Processors
Crypto Performance on ARM Cortex-M Processors
Hannes Tschofenig
 
From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...
From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...
From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...
NECST Lab @ Politecnico di Milano
 
p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0
Kentaro Ebisawa
 
NIOS II Processor.ppt
NIOS II Processor.pptNIOS II Processor.ppt
NIOS II Processor.ppt
Atef46
 
Make ARM Shellcode Great Again
Make ARM Shellcode Great AgainMake ARM Shellcode Great Again
Make ARM Shellcode Great Again
Saumil Shah
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...
inside-BigData.com
 
Make ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEKMake ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEK
Saumil Shah
 
Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000
Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000
Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000
Cisco Russia
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON
 
IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...
IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...
IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...
IRJET Journal
 
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Hsien-Hsin Sean Lee, Ph.D.
 
Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)
Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)
Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)
Takahiro Harada
 
SNAP MACHINE LEARNING
SNAP MACHINE LEARNINGSNAP MACHINE LEARNING
SNAP MACHINE LEARNING
Ganesan Narayanasamy
 

Similar to FPGA_BasedGCD (20)

Arm architecture
Arm architectureArm architecture
Arm architecture
 
Synopsys User Group Presentation
Synopsys User Group PresentationSynopsys User Group Presentation
Synopsys User Group Presentation
 
Hari Krishna Vetsa Resume
Hari Krishna Vetsa ResumeHari Krishna Vetsa Resume
Hari Krishna Vetsa Resume
 
Ambit Brochure Embedded Robotics 2023.pdf
Ambit Brochure Embedded Robotics 2023.pdfAmbit Brochure Embedded Robotics 2023.pdf
Ambit Brochure Embedded Robotics 2023.pdf
 
4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow
 
Arm architecture overview
Arm architecture overviewArm architecture overview
Arm architecture overview
 
Pipelining1
Pipelining1Pipelining1
Pipelining1
 
Crypto Performance on ARM Cortex-M Processors
Crypto Performance on ARM Cortex-M ProcessorsCrypto Performance on ARM Cortex-M Processors
Crypto Performance on ARM Cortex-M Processors
 
From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...
From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...
From FPGA-based Reconfigurable Systems to Autonomic Heterogeneous Computing S...
 
p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0
 
NIOS II Processor.ppt
NIOS II Processor.pptNIOS II Processor.ppt
NIOS II Processor.ppt
 
Make ARM Shellcode Great Again
Make ARM Shellcode Great AgainMake ARM Shellcode Great Again
Make ARM Shellcode Great Again
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...
 
Make ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEKMake ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEK
 
Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000
Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000
Особенности архитектуры и траблшутинга маршрутизаторов серии ASR1000
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
 
IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...
IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...
IRJET- An Improved DCM-Based Tunable True Random Number Generator for Xilinx ...
 
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
 
Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)
Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)
Introduction to Monte Carlo Ray Tracing, OpenCL Implementation (CEDEC 2014)
 
SNAP MACHINE LEARNING
SNAP MACHINE LEARNINGSNAP MACHINE LEARNING
SNAP MACHINE LEARNING
 

FPGA_BasedGCD