VHDL Project II: Bubble Sorter Matthew Murach Slides Available at: www.pages.drexel.edu/~mjm46.

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

Lecture 4. Topics covered in last lecture Multistage Switching (Clos Network) Architecture of Clos Network Routing in Clos Network Blocking Rearranging.
EELE 367 – Logic Design Module 4 – Combinational Logic Design with VHDL Agenda 1.Decoders/Encoders 2.Multiplexers/Demultiplexers 3.Tri-State Buffers 4.Comparators.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Finite State Machines Discussion D7.1 Mealy and Moore Machines.
Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
IT Systems Flip - Flops EN230-1 Justin Champion C208 –
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
9/15/09 - L25 Registers & Load Enable Copyright Joanne DeGroat, ECE, OSU1 Registers & Load Enable.
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
Digital Arithmetic and Arithmetic Circuits
Chapter 14 Introduction to Microprocessors. 2 Microcomputer A self-contained computer system that consists of CPU (central processing unit), memory (RAM.
1 Part I: SYSTEM DESIGN. 2 Packages and Components Functions and Procedures Problem (Design & Implementation) Additional System Designs.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
VHDL Project I: Introduction to Testbench Design Matthew Murach Slides Available at:
1 Sequential Logic Lecture #7. 모바일컴퓨팅특강 2 강의순서 Latch FlipFlop Shift Register Counter.
ENG241 Digital Design Week #4 Combinational Logic Design.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
VHDL Project II: Array Multiplier
ENG241 Digital Design Week #8 Registers and Counters.
Basic Overview of VHDL Matthew Murach Slides Available at:
The Fundamentals: Algorithms, the Integers & Matrices.
ENG2410 Digital Design LAB #5 Modular Design and Hierarchy using VHDL.
1 Today’s Material Iterative Sorting Algorithms –Sorting - Definitions –Bubble Sort –Selection Sort –Insertion Sort.
Sorting CS 110: Data Structures and Algorithms First Semester,
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
ALU (Continued) Computer Architecture (Fall 2006).
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
Lecture #18 Page 1 ECE 4110– Sequential Logic Design Lecture #18 Agenda 1.MSI Demultiplexers 2.MSI Tri-State Buffers 3.MSI Comparators Announcements 1.HW.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Digital System Design using VHDL
L20 – Register Set. The 430 Register Set  Not exactly a dual ported register set, but a dual drive register set.  Ref: text Unit 10, 17, 20 9/2/2012.
VHDL Project I: Serial Adder Matthew Murach Slides Available at:
ECE 545—Digital System Design with VHDL Lecture 1
Slide 1 3.VHDL/Verilog Description Elements. Slide 2 To create a digital component, we start with…? The component’s interface signals Defined in MODULE.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
LAB #5 Modular Design and Hierarchy using VHDL
A Case Study of the Rehosting from VHDL to Matlab/C
REGISTER TRANSFER LANGUAGE (RTL)
Registers and Counters
Reg and Wire:.
ENG2410 Digital Design “Combinational Logic Design”
ECE 4110–5110 Digital System Design
Dataflow Style Combinational Design with VHDL
Combinational Circuits Using VHDL
IAS 0600 Digital Systems Design
UNIT 2: Data Flow description
VHDL Hierarchy in XILINX
VHDL (VHSIC Hardware Description Language)
VHDL Discussion Subprograms
VHDL Structural Architecture
ECE 545—Digital System Design with VHDL Lecture 1
VHDL Introduction.
VHDL Discussion Subprograms
ECE 331 – Digital System Design
Sequntial-Circuit Building Blocks
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

VHDL Project II: Bubble Sorter Matthew Murach Slides Available at:

Bubble Sort Description Takes a certain number of values and sorts them in ascending order Takes a certain number of values and sorts them in ascending order Project consists of a simple four bit comparator which interchanges values when required. Project consists of a simple four bit comparator which interchanges values when required. Logic is needed to wire the comparators together. (master->component design) Logic is needed to wire the comparators together. (master->component design) Bubble sort has a worst case complexity of O(N) where N is the number of numbers to be sorted. Bubble sort has a worst case complexity of O(N) where N is the number of numbers to be sorted.

Method One: Logic Flow (4 number example) st Stage: Sequence R-L-R-L nd Stage: Sequence L-R-L-R rd Stage: Sequence R-L-R-L th Stage: Sequence L-R-L-R (DONE) = basic PE element (four required) = denotes swap operation

Processing Element Ld : in std_logic_vector(3 downto 0) – initial value R : in std_logic_vector (3 downto 0) – right register value L : in std_logic_vector (3 downto 0) – right register value Ck : in std_logic; -- clock input En : in std_logic; -- enable Wr : in std_logic; -- load register Sw : in std_logic; -- R or L read Rd : in std_logic; -- Read result Output : out std_logic_vector(3 downto 0) L_o : out std_logic_vector (3 downto 0) – pass result to the left register R_o : out std_logic_vector (3 downto 0) – pass result to the left register

Disadvantages of Method 1 Messy boundary conditions Messy boundary conditions Need a special value at the ‘end’ nodes Need a special value at the ‘end’ nodes Or need to use non-standard PEs Or need to use non-standard PEs Wire intensive Wire intensive Uses lots of wires (11 total signals) Uses lots of wires (11 total signals) A pain to route all that internal wiring in the master design (what if we want more control on the swap which would require another 4 wires….) A pain to route all that internal wiring in the master design (what if we want more control on the swap which would require another 4 wires….) PE is complicated PE is complicated

Method Two: Make it simple Why not use registers to store values instead of the processing units? (uses three simple PEs) Why not use registers to store values instead of the processing units? (uses three simple PEs) AB 8573 C 5837 = Register = PE

PE for Method Two Ck : in std_logic; -- Clock En : in std_logic; -- En C : out std_logic_vector(3 downto 0); D : out std_logic_vector(3 downto 0); A : in std_logic_vector(3 downto 0); B : in std_logic_vector(3 downto 0);

Method 2: Examined Only 6 wires need to be routed (8 if control is desired on the write ports) Only 6 wires need to be routed (8 if control is desired on the write ports) Simple design Simple design No need for fancy internal logic (R, L states) No need for fancy internal logic (R, L states) Just compare the two values and swap if necessary Just compare the two values and swap if necessary Compare logic is fixed with respect to input Compare logic is fixed with respect to input Need extra logic for a register but that is trivial. Need extra logic for a register but that is trivial.

Component Declarations Component declaration is nearly same as the device’s entity declaration. Component declaration is nearly same as the device’s entity declaration. Simply Copy and Paste in the component descriptions and add the key word component. Simply Copy and Paste in the component descriptions and add the key word component. Component bubble_sort is port ( -- stuff here ); end component; Entity bubble_sort is port ( -- stuff here ); end bubble_sort;

Internal Signals and Port Mappings Internal wiring is done with signals. Simply declare these signals like you have done in previous exercises. Internal wiring is done with signals. Simply declare these signals like you have done in previous exercises. Port mapping is the where the actual components are instantiated and mapped to their respective signals. Port mapping is the where the actual components are instantiated and mapped to their respective signals. Note that you can instantiate more then one instance of each component. Note that you can instantiate more then one instance of each component.

Example of Port Mapping Let’s say you want to make a master VHDL design from the two components on the right. Let’s say you want to make a master VHDL design from the two components on the right. -- Signal Declarations Signal N : std_logic; Signal M : std_logic; Begin -- Port Map Declarations My_A : Acomp generic map(N) port map(N,M,ck); My_B : Bcomp generic map(N) port map(M,N,ck); A Component B Component C Component M N Ck