Single bit comparator Single bit comparator 4/10/2007 DSD,USIT,GGSIPU

Slides:



Advertisements
Similar presentations
Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
Advertisements

EELE 367 – Logic Design Module 4 – Combinational Logic Design with VHDL Agenda 1.Decoders/Encoders 2.Multiplexers/Demultiplexers 3.Tri-State Buffers 4.Comparators.
Magnitude Comparator Lecture L6.4 Section 6.1.
28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Arbitrary Waveform Discussion 5.5 Example 34.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Adder Discussion D6.2 Example 17. s i = c i ^ (a i ^ b i ) c i+1 = a i * b i + c i * (a i ^ b i ) Full Adder (Appendix I)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
1 Comparators Discussion D A 1-Bit Comparator The variable Gout is 1 if x > y or if x = y and Gin = 1. The variable Eout is 1 if x = y and Gin =
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
1 Comparators: Procedures Discussion D9.2 Example 22.
EE 367 – Logic Design Lecture #17
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
Data Flow Modeling of Combinational Logic Simple Testbenches
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
DSD,USIT,GGSIPU1 Entity declaration –describes the input/output ports of a module entity reg4 is port ( d0, d1, d2, d3, en, clk : in std_logic; q0, q1,
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
1/8/ L7 Project Step 3Copyright Joanne DeGroat, ECE, OSU1 Project Step 4 Step 1 in transitioning to behavioral modeling. We will wire behavioral.
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
BR 1/991 Dice Game Implementation Why was dice game implemented in three 22V10 PLDs? What are the resources needed by the Dice Game? –Outputs: 6 for dice.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
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.
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
CS/EE 3700 : Fundamentals of Digital System Design
BR 8/99 Arithmetic Operations We will review the arithmetic building blocks we have previously used, and look at some new ones. –Addition –incrementer.
Lecture #17 Page 1 ECE 4110–5110 Digital System Design Lecture #17 Agenda 1.MSI Multiplexers 2.MSI Encoders Announcements Test 1 closed book, Wednesday.
Show who is the BOSS Issues with VHDL Synthesis. VHDL Simulator versus Synthetiser VHDL Simulator follows the strict VHDL rules. It does not produce a.
QUIZ What Circuit is this ?. Entity (The Object) -- Entity informs about the circuit’s interface -- signals entity my_circuit is port (L0, L1, L2, L3.
Comparators Combinational Design. Comparators Equality and Magnitude Comparators –CSE 171 (Designed using CUPL) TTL Comparators Comparator Networks Cascading.
Lecture #18 Page 1 ECE 4110–5110 Digital System Design Lecture #18 Agenda 1.MSI Demultiplexers 2.MSI Tri-State Buffers 3.MSI Comparators Announcements.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
Combinational logic circuit
Conditional Signal Assignment
Describing Combinational Logic Using Processes
ECE 4110–5110 Digital System Design
Hardware Description Languages
ECE 4110–5110 Digital System Design
Dataflow Style Combinational Design with VHDL
Comparators Discussion DS-3.1.
Combinational Circuits Using VHDL
Advanced Digital design
آرایه های دروازه ای قابل برنامه ریزی میدانی
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL (VHSIC Hardware Description Language)
VHDL Structural Architecture
Concurrent vs Sequential
ECE 331 – Digital System Design
Data Flow Description of Combinational-Circuit Building Blocks
Data Flow Description of Combinational-Circuit Building Blocks
Copyright Joanne DeGroat, ECE, OSU
Magnitude Comparator Lecture L6.2 Section 6.1.
CprE / ComS 583 Reconfigurable Computing
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

Single bit comparator Single bit comparator 4/10/2007 DSD,USIT,GGSIPU gr: a(1) >a(0) A(1) sm: a(1) <a(0) A(0) eq: a(1)=a(0) 4/10/2007 DSD,USIT,GGSIPU

Truth table A(1) A(0) Gr Sm Eq 1 4/10/2007 DSD,USIT,GGSIPU

Boolean equation Gr <= a(1) and (not a(0)) Le <= a 4/10/2007 DSD,USIT,GGSIPU

VHDL Code 4/10/2007 DSD,USIT,GGSIPU entity singlebitcomparator is Port ( a : in std_logic_vector(1 downto 0); en: in std_logic; gt : out std_logic; sm : out std_logic; eq : out std_logic); end singlebitcomparator; architecture Behavioral of singlebitcomparator is begin process (en,a) if (a(1)>a(0)) then gt <= '1'; sm <= '0'; eq <= '0'; elsif (a(1) < a(0)) then gt <= '0'; sm <= '1'; eq <= '0'; else gt <= '0'; sm <= '0'; eq <= '1'; end if; end process; end Behavioral; 4/10/2007 DSD,USIT,GGSIPU

Waveform of single bit comparator 4/10/2007 DSD,USIT,GGSIPU

4-bit comparator 4-bit comparator A B 4/10/2007 DSD,USIT,GGSIPU

Boolean equation for 4-bit comparator Let A=a3a2a1a0 Let B=b3b2b1b0 Intermediate signal : i3,i2,i1 and i0 AeqB= i3i2i1i0 AgtB = a3(b3bar)+i3a2(b2bar)+i3i2a1(b1bar)+i3i2i1a0(b0bar) AltB = Not(AeqB+AgtB) 4/10/2007 DSD,USIT,GGSIPU

VHDL code of 4-bit comp 4/10/2007 DSD,USIT,GGSIPU entity comp4bit is Port ( x : in std_logic_vector(3 downto 0); y : in std_logic_vector(3 downto 0); en: in std_logic; greater : out std_logic; smaller : out std_logic; equal : out std_logic); end comp4bit; architecture Behavioral of comp4bit is component singlebitcomparator is Port ( a : in std_logic_vector(1 downto 0); gt : out std_logic; sm : out std_logic; eq : out std_logic); end component singlebitcomparator; signal temp : std_logic_vector(10 downto 0); 4/10/2007 DSD,USIT,GGSIPU

greater <= temp(0) or temp(3) or temp(6) or temp(9); begin u1: singlebitcomparator port map(a(1)=>x(3),a(0)=>y(3),en=>en,gt=>temp(0),sm=>temp(1),eq=>temp(2)); u2: singlebitcomparator port map(a(1)=>x(2),a(0)=>y(2),en=>temp(2),gt=>temp(3),sm=>temp(4),eq=>temp(5)); u3: singlebitcomparator port map(a(1)=>x(1),a(0)=>y(1),en=>temp(5),gt=>temp(6),sm=>temp(7),eq=>temp(8)); u4: singlebitcomparator port map(a(1)=>x(0),a(0)=>y(0),en=>temp(8),gt=>temp(9),sm=>temp(10),eq=>equal); greater <= temp(0) or temp(3) or temp(6) or temp(9); smaller <= temp(1) or temp(4) or temp(7) or temp(10); end Behavioral; 4/10/2007 DSD,USIT,GGSIPU

Waveform of 4-bit comparator 4/10/2007 DSD,USIT,GGSIPU