Registers Lab 5 Mano and Kime Sections 5-2, 5-3, 5-7.

Slides:



Advertisements
Similar presentations
Arbitrary Waveform Discussion 5.5 Example 34.
Advertisements

Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
A Simple Microcontroller VHDL Tutorial R. E. Haskell and D. M. Hanna T6: VHDL State Machines.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
Integer Square Root.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
Single-Cycle Instructions VHDL Tutorial R. E. Haskell and D. M. Hanna T5: VHDL ROM.
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.
Structural VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T3: ALU Design.
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.
Lab 6 Program Counter and Program ROM Mano & Kime Sections 7-1 – 7-6.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
Lecture L6.2 VHDL Multiply Operator (*)
The FC16 Forth Core Lab 7 Module F4.1. Lab 7 Hex OpcodeNameFunction 0000NOP No operation 0001DUP Duplicate T and push data stack. N
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 3 Khurram Kazi Some of the slides were taken from K Gaj ’ s lecture slides from GMU ’ s VHDL.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
FPGAs and VHDL Lecture L13.1 Sections 13.1 – 13.3.
Digilab 7-Segment Displays Lab 4. selyInstruction name “000”true if b = a false otherwise = “001”true if b /= a false otherwise “010”true if b < a.
Sequencing and Control Mano and Kime Sections 8-1 – 8-7.
Finite State Machines Discussion D8.1 Example 36.
Logic Design Fundamentals - 2 Lecture L1.2. Logic Design Fundamentals - 2 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Programming Example Lecture 8.6 A VHDL Forth Core for FPGAs: Sect. 7.
Binary-to-BCD Converter
7-Segment Displays VHDL Tutorial R. E. Haskell and D. M. Hanna T4: Xilinx LogiBLOX.
Sequential Multiplication Lecture L6.4. Multiplication 13 x = 8Fh 1101 x
LCD Display DIO2 Board CPLD. DIO2 Board CPLD Interface LCD Display.
Binary-to-BCD Converter
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);
VHDL Examples Subra Ganesan Reference: Professor Haskell’s Notes,
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
ECE 448: Spring 12 Lab Midterm Exam Review. Part 1: Detailed discussion of a selected midterm from Spring Part 2: Review & discussion of common.
Binary-to-BCD Converter
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Data Storage VHDL ET062G & ET063G Lecture 4 Najeem Lawal 2012.
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
Number Representation and Arithmetic Circuits
Lecture 8 Review Combinational Devices –Decoder –Multiplexor (Bhasker p-81) –Shifter –Barrel Shifter (Bhasker p-303)
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Lecture 11 Xilinx FPGA Memories Part 2
Prime Numbers Lecture L6.1 Sieve of Eratosthenes.
Multiplier: Functions Discussion D7.2 Example 19.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
Sequential statements (1) process
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Part III: SYSTEM DESIGN
Part IV: VHDL CODING.
Mano and Kime Sections 7-6 – 7-8
مدار های ترکیبی دیکدر لامپ های هفت قسمتی یکی از دیکدر هایی که اغلب به کار برده می شود،دیکدر 4 به 7 برای تبدیل کد bcd به کد هفت بیتی برای لامپ های seven.
Binary-to-BCD Converter
A Greatest Common Divisor (GCD) Processor
Fibonacci Sequence Lecture L4.1 Lab 3.
Multiplication Discussion 11.1.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
Data Flow Description of Combinational-Circuit Building Blocks
DIO2 Board Projects.
Fast, Asynchronous SRAM
Data Flow Description of Combinational-Circuit Building Blocks
Sequntial-Circuit Building Blocks
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
(Sequential-Circuit Building Blocks)
Presentation transcript:

Registers Lab 5 Mano and Kime Sections 5-2, 5-3, 5-7

4-Bit Register

library IEEE; use IEEE.std_logic_1164.all; entity reg is generic(width: positive); port ( d: in STD_LOGIC_VECTOR (width-1 downto 0); load: in STD_LOGIC; clr: in STD_LOGIC; clk: in STD_LOGIC; q: out STD_LOGIC_VECTOR (width-1 downto 0) ); end reg; A Generic Register

architecture reg_arch of reg is begin process(clk, clr) begin if clr = '1' then for i in width-1 downto 0 loop q(i) <= '0'; end loop; elsif (clk'event and clk = '1') then if load = '1' then q <= d; end if; end process; end reg_arch; Infers a flip-flop for all outputs (q)

debounce entity entity debounce is port ( inp, clk, clr: in std_logic; outp: out std_logic ); end debounce; debounce inpoutp clk clr

clk inp delay1 delay3 delay2 outp debounce

clk inp delay1 delay3 delay2 outp

architecture rtl of debounce is signal delay1, delay2, delay3: std_logic; begin process(clk, clr) begin if clr = '1' then delay1 <= '0'; delay2 <= '0'; delay3 <= '0'; elsif clk'event and clk='1' then delay1 <= inp; delay2 <= delay1; delay3 <= delay2; end if; end process; outp <= delay1 and delay2 and (not delay3); end rtl; debounce architecture

Lab 5 – A Single-Cycle Processor

fcode (hex) Namey 10+ b + a 11- b - a 121+ a a INVERT Complement all bits of a. 15AND b and a 16OR b or a 17XOR b xor a 182* Logic shift left a. 19U2/ Logic shift right a. 1A2/ Arithmetic shift right a. 1BRSHIFT Shift b a bits to the right. SHR(b,a); 1CLSHIFT Shift b a bits to the left. SHL(b,a); 1D Reserved for multiplication 1E Reserved for division Add:

20TRUE Set all bits in a to ‘1’. 21FALSE Clear all bits in a to ‘0’. 22NOT 0= TRUE if all bits in a are ‘0’. 230< TRUE if sign bit of a is ‘1’. 24U> TRUE if b > a (unsigned), else FALSE 25U< TRUE if b < a (unsigned), else FALSE 26= TRUE if b = a, else FALSE 27U>= TRUE if b >= a (unsigned), else FALSE 28U<= TRUE if b <= a (unsigned), else FALSE 29<> TRUE if b /= a, else FALSE 2A> TRUE if b > a (signed), else FALSE 2B< TRUE if b < a (signed), else FALSE 2C>= TRUE if b >= a (signed), else FALSE 2D<= TRUE if b <= a (signed), else FALSE fcode (hex) Namey Add:

clk_pulse.vhd

Pcount.vhd -- A 4-bit up-counter library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity Pcount is port ( clr: in STD_LOGIC; clk: in STD_LOGIC; q: out STD_LOGIC_VECTOR (3 downto 0) ); end Pcount;

architecture Pcount_arch of Pcount is signal COUNT: STD_LOGIC_VECTOR (3 downto 0); begin process (clk, clr) begin if clr = '1' then COUNT <= "0000"; elsif clk'event and clk='1' then COUNT <= COUNT + 1; end if; q <= COUNT; end process; end Pcount_arch; Pcount.vhd (cont.)

dig7seg.vhd

Prom Single-cycle microcoded instructions InstructionOperation DUP Duplicate T to N. SWAP Swap the contents of T and N Load the 8-bit byte from SW(1:8) into T and push T to N Additional Instructions

library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity Prom is port ( addr: in STD_LOGIC_VECTOR (3 downto 0); M: out STD_LOGIC_VECTOR (8 downto 0) ); end Prom; Prom.vhd

architecture Prom_arch of Prom is constant dup: STD_LOGIC_VECTOR (9 downto 0) := " "; constant swap: STD_LOGIC_VECTOR (9 downto 0) := " "; constant Sfetch: STD_LOGIC_VECTOR (9 downto 0) := " "; constant plus: STD_LOGIC_VECTOR (9 downto 0) := " "; constant oneplus: STD_LOGIC_VECTOR (9 downto 0) := " "; constant invert: STD_LOGIC_VECTOR (9 downto 0) := " "; constant orr: STD_LOGIC_VECTOR (9 downto 0) := " "; constant twotimes: STD_LOGIC_VECTOR (9 downto 0) := " "; constant lshift: STD_LOGIC_VECTOR (9 downto 0) := " " Prom.vhd

Lab 5 – A Single-Cycle Processor

Lab5.whp HEX lshift\ or\ *\ D26E D26E 00A4 +\ D312 invert\ 2CED 1+\ 2CEE

subtype rom_word is std_logic_vector(9 downto 0); type rom_array is array (NATURAL range <>) of rom_word); constant rom: rom_array := ( Sfetch, -- then set switches to 08 hex Sfetch, lshift, Sfetch, orr, twotimes, Sfetch, plus, invert, oneplus, X”0000”, X”0000” ); begin process(addr) variable j: integer; begin j := conv_integer(addr); M <= rom(j); end process; end Prom_arch; Prom.vhd (cont.)