1 RAM. 2 PS2_Keyboard: entity work.Keyboard generic map (AddressBits => ADDRESSLENGTH) port map (Reset => Reset, Clock => ClockVGA, PS2Clock => PS2Clock,

Slides:



Advertisements
Similar presentations
28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
Advertisements

History TTL-logic PAL (Programmable Array Logic)
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)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Decoders and Encoders Lecture L4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Integer Square Root.
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.
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.
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.
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.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
Finite State Machines Discussion D8.1 Example 36.
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.
Registers Lab 5 Mano and Kime Sections 5-2, 5-3, 5-7.
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);
Random-Access Memory Distributed and Block RAM Discussion D10.3 Example 41.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
ECE 448: Lab 4 FIR Filters.
CMPUT Computer Organization and Architecture II 1 CMPUT329 - Fall 2003 Topic 6: Testbenches Paras Mehta and José Nelson Amaral.
LAB 9 Finite State Machine (FSM) Ui Luu Glendale Community College Bassam Matar Chandler-Gilbert Community College.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Designing with FPGAs ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
1 Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
George Mason University ECE 545 – Introduction to VHDL Variables, Functions, Memory, File I/O ECE 545 Lecture 7.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
Processador 8 bits de dados e 16 bits de endereço ROM RAM I/O x”0000” x”3FFF” x”4000” x”7FFF” x”8000” x”FFFF” master.
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
ECE-C302 Serial Addition – A Finite State Machine 1. Serial Parity Checker 2. Decimal Serial Adder 3. Radix r Serial Adder.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
Memory 설계.
 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.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
VHDL Hardware Description Language. GUIDELINES How to write HDL code: How to write HDL code:
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.
George Mason University Controllers for Keccak_F and AES ECE 545 Lecture 11 Addendum.
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Algorithmic State Machines Sorting Signed & Unsigned Data Types
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Number Representation and Arithmetic Circuits
Lecture 11 Xilinx FPGA Memories Part 2
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #19 –VHDL.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Sequential statements (1) process
Combinational logic circuit
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Part III: SYSTEM DESIGN
Hardware Description Languages
Part IV: VHDL CODING.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
مدار های ترکیبی دیکدر لامپ های هفت قسمتی یکی از دیکدر هایی که اغلب به کار برده می شود،دیکدر 4 به 7 برای تبدیل کد bcd به کد هفت بیتی برای لامپ های seven.
Figure 8.1. The general form of a sequential circuit.
Variables variable variable_name: variable_type
High-Low Guessing Game
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
(Sequential-Circuit Building Blocks)
Presentation transcript:

1 RAM

2 PS2_Keyboard: entity work.Keyboard generic map (AddressBits => ADDRESSLENGTH) port map (Reset => Reset, Clock => ClockVGA, PS2Clock => PS2Clock, PS2Data => PS2Data, ASCII => ASCII, WriteEnable => WriteEnable, WriteAddress => WriteAddress); APPLICATION-SPECIFIC BLOCK B e g i n Input from keyboard and output to VGA RAM Arithmetic: entity work.ArithmeticBlock generic map (AddressBits => ADDRESSLENGTH, StateMaxValue => 52, NumberOfColumns => TEXTCOLUMNS ) port map ( ASCII_in => ASCII, ASCII_out => RAMData, Address_in => WriteAddress, Address_out => RAMWriteAddress, clk => ClockVGA, rst => Reset, WE_in => WriteEnable, WE_out => RAMWriteEnable); APPLICATION-SPECIFIC BLOCK E n d Arithmetic WriteEnable ASCII code WriteAddress

3 Arithmetic WriteEnable ASCII code WriteAddress APPLICATION-SPECIFIC BLOCK B e g i n Input from keyboard and output to VGA RAM Arithmetic: entity work.ArithmeticBlock generic map (AddressBits => ADDRESSLENGTH, StateMaxValue => 52, NumberOfColumns => TEXTCOLUMNS ) port map ( ASCII_in => ASCII, ASCII_out => RAMData, Address_in => WriteAddress, Address_out => RAMWriteAddress, clk => ClockVGA, rst => Reset, WE_in => WriteEnable, WE_out => RAMWriteEnable); APPLICATION-SPECIFIC BLOCK E n d VGA_RAM: entity work.RAM generic map (AddressBits => ADDRESSLENGTH, DataBits => 8) port map (Clock => ClockVGA, WriteAddress => RAMWriteAddress, WriteEnable => RAMWriteEnable, DataIn => RAMData, ReadAddress => ReadAddress, DataOut => SymbolPos); ASCII WE WA

RAM 4 Arithmetic WriteEnable ASCII code WriteAddress ASCII WE WA A Address_out <= conv_std_logic_vector((line*NumberOfColumns + column),AddressBits);

ASCII_out Address_out WE_out 5 entity ArithmeticBlock is generic ( AddressBits : natural; StateMaxValue : natural; NumberOfColumns : natural ); Port ( ASCII_in : in STD_LOGIC_VECTOR (7 downto 0); ASCII_out : out STD_LOGIC_VECTOR (7 downto 0); Address_in : in STD_LOGIC_VECTOR (AddressBits - 1 downto 0); Address_out : out STD_LOGIC_VECTOR (AddressBits - 1 downto 0); clk : in STD_LOGIC; rst : in STD_LOGIC; WE_in : in STD_LOGIC; WE_out : out STD_LOGIC ); end ArithmeticBlock; ASCII_in Address_in WE_in clock (clk) reset (rst) – active ‘1’

6 architecture Behavioral of ArithmeticBlock is signal Op1: STD_LOGIC_VECTOR(7 downto 0); -- one decimal digit in binary code signal Op2: STD_LOGIC_VECTOR(7 downto 0); -- one decimal digit in binary code signal sum: STD_LOGIC_VECTOR(7 downto 0); -- binary signal Difference: STD_LOGIC_VECTOR(7 downto 0); -- binary signal sumMSB: STD_LOGIC_VECTOR(7 downto 0); -- ASCII signal sumLSB: STD_LOGIC_VECTOR(7 downto 0); -- ASCII signal DifLSB: STD_LOGIC_VECTOR(7 downto 0); -- ASCII signal sign: STD_LOGIC_VECTOR(7 downto 0); -- ASCII signal state: integer range 0 to StateMaxValue; signal line, line_local : integer range 0 to 39; signal column, column_local : integer range 0 to 79; signal ASCII_local : std_logic_vector(7 downto 0); signal Operand1: string(1 to 16):= "Operand 1 = "; constant Operand2: string(1 to 16):= "Operand 2 = "; constant SumR: string(1 to 16):= "Sum = "; constant DifR: string(1 to 16):= "Difference = "; sum = Op1 + Op2; Difference = Op1 - Op2;

7 type rom_type is array (0 to 99) of std_logic_vector (7 downto 0); constant ROM : rom_type := (" "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " ", " "," "," "," "," "," "," "," "," ", " " );

8 -- arithmetical operations: sum and difference sum <= ("0000"&(Op1(3 downto 0)))+("0000"&(Op2(3 downto 0))); difference <= ("0000"&(Op1(3 downto 0)))-("0000"&(Op2(3 downto 0))) when ("0000"&(Op1(3 downto 0)))>=("0000"&(Op2(3 downto 0))) else ("0000"&(Op2(3 downto 0)))-("0000"&(Op1(3 downto 0))); sign<= std_logic_vector(to_unsigned(character'pos(' '), 8)) when ("0000"&(Op1(3 downto 0)))>=("0000"&(Op2(3 downto 0))) else std_logic_vector(to_unsigned(character'pos('-'), 8)); sumMSB <= "0011" & ROM(conv_integer(sum))(7 downto 4); sumLSB <= "0011" & ROM(conv_integer(sum))(3 downto 0); DifLSB <= "0011" & ROM(conv_integer(difference))(3 downto 0); -- taking operands from keyboard Op1 <= " " when rst = '1' else ASCII_in when ((ASCII_in >= " ") and (ASCII_in <= " ")) and (Address_in(0) = '0') and (WE_in = '1'); Op2 <= " " when rst = '1' else ASCII_in when ((ASCII_in >= " ") and (ASCII_in <= " ")) and (Address_in(0) = '1') and (WE_in = '1');

9 process(clk, rst) begin if rst = '1' then state <= 0; elsif falling_edge(clk) then if state=StateMaxValue then state<=0; else state<= state + 1; end if; end if; end process; process(clk, rst) begin if rst= '1' then null; elsif rising_edge(clk) then case state is when 1 to 16 => line_local <= 9; column_local <= 14 + state; ASCII_local <= std_logic_vector(to_unsigned(character'pos(Operand1(state)), 8)); when 17 to 32 => line_local <= 10; column_local <= 14 + state - 16; ASCII_local <= std_logic_vector(to_unsigned(character'pos(Operand2(state-16)), 8)); when 33 => line_local <= 9; column_local <= ; ASCII_local <= Op1; when 34 => line_local <= 10; column_local <= ; ASCII_local <= Op2;

10 when 1 to 16 => line_local <= 9; column_local <= 14 + state; ASCII_local <= std_logic_vector(to_unsigned(character'pos(Operand1(state)), 8)); signal Operand1: string(1 to 16):= "Operand 1 = "; Operand 1 =

11 when 33 => line_local <= 9; column_local <= ; ASCII_local <= Op1; Operand 1 =

12 when 35 to 50 => line_local <= 11; column_local <= 14 + state - 34; ASCII_local <= std_logic_vector (to_unsigned(character'pos(SumR(state-34)), 8)); when 51 => line_local <= 11; column_local <= ; ASCII_local <= sumMSB; when 52 => line_local <= 11; column_local <= ; ASCII_local <= sumLSB; when 53 to 68 => line_local <= 12; column_local <= 14 + state - 52; ASCII_local <= std_logic_vector (to_unsigned(character'pos(DifR(state-52)), 8)); when 69 => line_local <= 12; column_local <= ; ASCII_local <= sign; when 70 => line_local <= 12; column_local <= ; ASCII_local <= DifLSB; when others =>null; end case; end if; end process;

13 Operand 1 = 3 Operand 2 = 8 Sum = 11 Difference = -5 Op1 = 3 Op2 = 8