Dvojiška aritmetika. Miha Moškon. UL-FRI (R3.61)
|
|
- Amos Strickland
- 5 years ago
- Views:
Transcription
1 Dvojiška aritmetika Miha Moškon UL-FRI (R3.61)
2 Zapis predznačenih števil Zapis predznak in velikost Zapis z odmikom Eniški komplement Dvojiški komplement
3 Zapis predznak in velikost najvišji bit določa predznak 0: pozitivno število 1: negativno število ostali biti določajo velikost števila prednost lahko berljiv zapis slabosti posebna obravnava MSB bita pri aritmetičnih operacijah seštevanje/odštevanje: primerjati moramo velikosti operandov, da določimo predznak rezultata dve ničli Primer: 3-bitno število binarno vrednost
4 Zapis predznak in velikost Obseg števil za n bitov: Primer: 4-bitno število
5 Zapis z odmikom množico vrednosti razpolovimo na negativne in pozitivne kjer smo razpolovili, imamo 0 odmik primer: 3-bitno število odmik = 3 vrednost = zapis 3 prednosti: samo ena ničla slabosti: pri aritmetičnih operacijah moramo odmik eksplicitno upoštevati Primer: 3-bitno število binarno vrednost
6 Zapis z odmikom primer seštevanja dveh števil: Primer: 3-bitno število binarno vrednost Rezultat je napačen! Zakaj? števili, ki ju seštevamo števili zapisani z odmikom odmik V primeru seštevanja, dobimo torej dva odmika in moramo enega odšteti: Kaj pa odštevanje in množenje?
7 Eniški komplement negativno vrednost števila dobimo tako, da invertiramo vse bite v zapisu eniški komplement števila p v n-bitnem zapisu dobimo z enačbo: slabosti primer (n=3): dve ničli aritmetika: v določenih primerih napačen rezultat popravek : negativno vrednost potegnemo za 1 navzgor Primer: 3-bitno število binarno vrednost
8 Dvojiški komplement negativno vrednost števila dobimo tako, da invertiramo vse bite v zapisu in prištejemo 1 z drugimi besedami: vrednosti negativnega števila v eniškem komplementu prištejemo 1 dvojiški komplement števila p v n-bitnem zapisu dobimo z enačbo: prednosti: samo ena ničla ni težav z aritmetičnimi operacijami Primer: 3-bitno število binarno vrednost
9 Dvojiški komplement Samo 1 ničla V zapisu je negativnih števil za 1 več kot pozitivnih števil. Primer: 4-bitna števila
10 Dvojiški komplement Primer ročne pretvorbe: n = 11 p = 405= ( ) = k =
11 Seštevanje z dvojiškim komplementom
12 Odštevanje z dvojiškim komplementom
13 Preliv (Overflow) n-bitni zapis: števila v razponu primer: n =3: [-4,3] n = 16: [-32768,32767]: če prištejemo 1, dobimo narobe Če rezultata ne moremo zapisati v območju predstavitve števila, govorimo o prelivu/prekoračitvi (arithmetic overflow) Potrebujemo logiko za zaznavanje preliva!
14 Primeri preliva Če imajo števila različne predznake, do preliva ne more priti!
15 Zaznavanje preliva Seštevanje dveh pozitivnih števil nam vrne negativno število (MSB števil je 0, MSB rezultata je 1). Seštevanje dveh negativnih števil na vrne pozitivno število (MSB števil je 1, MSB rezultata je 0). Zaznavanje preliva:
16 Zaznavanje preliva Preliv lahko izrazimo s prenosoma pri seštevanju najbolj pomembnih bitov a n-1 b n-1 c n-1 c n s n-1 V c n c n-1 c n in c n
17 Izogibanje prelivu Razteg predznaka (angl. sign extension). Podvojimo MSB, ki v dvojiškem komplementu določa predznak. Pri seštevanju dveh n-bitnih števil, tako dobimo (n+1)-bitni rezultat do preliva ne more priti! Prenos na MSB lahko ignoriramo. Primer: brez razširitve: 4 6 = = = 6 z razširitvijo: 4 6 = (1) (1) = ( ) = = - 10
18 Števila v jeziku VHDL Nepredznačena števila: v dvojiškem zapisu je MSB na levi. Predznačena števila: dvojiški komplement za negativna števila; MSB določa predznak. Vgrajeni številski tipi omejeni: npr. integer je 32-bitno število, ki ne podpira bitnih operacij in indeksiranja (načeloma se uporablja le za konstante). type INTEGER is range to ; subtype NATURAL is INTEGER range 0 to ; subtype POSITIVE is INTEGER range 1 to ; Uporaba knjižnic za dodatne podatkovne tipe.
19 Števila v jeziku VHDL Knjižnica: std_logic_arith: knjižnica proizvajalca Synopsis omogoča deklaracijo tipov signed in unsigned: signal a: signed(7 downto 0); signal b: unsigned(7 downto 0); podpira aritmetične operacije nad števili (npr. + in -) vektor nima numerične interpretacije type SIGNED is array(natural range <>) of STD_LOGIC; type UNSIGNED is array(natural range <>) of STD_LOGIC; Od -128 do 127 Od 0 do 255 uporaba skupaj s knjižnicama za avtomatsko intepretacijo std_logic vektorja (ne uporabljaj obeh hkrati) UNSIGNED aritmetika skupaj z uporabo knjižnice std_logic_unsigned SIGNED aritmetika skupaj z uporabo knjižnice std_logic_signed
20 Števila v jeziku VHDL Knjižnice: numeric_std, numeric_bit: IEEE knjižnici za numerične operacije na std_logic in bit podatkovnih tipih. omogoča deklaracijo tipov signed in unsigned alternativa knjižnici arith redko kombinacija s knjižnicama std_logic_unsigned ali std_logic_signed. Nikoli std_logic_arith in numeric_std hkrati (konflikt)! type SIGNED is array(natural range <>) of STD_LOGIC; type UNSIGNED is array(natural range <>) of STD_LOGIC; type SIGNED is array(natural range <>) of BIT; type UNSIGNED is array(natural range <>) of BIT;
21 Števila v jeziku VHDL Rezultat nad dvema vektorjema različnih velikosti je dolžine daljšega vektorja. Rezanje prekoračitve.
22 Števila v jeziku VHDL library ieee ; use ieee.std_logic_1164.all ; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all ; signal A:unsigned(3 downto 0); signal B:signed (3 downto 0); signal C:std_logic_vector (3 downto 0); A <= "1111"; -- A = B <= "1111"; -- B = (-1) 10 C <= "1111"; -- C = 15 10, ker je vključena std_logic_unsigned
23 Pretvorba med tipi Pomembni tipi: signed, unsigned, integer, std_logic_vector Funkcije za pretvorbo med tipi: conv_[type] asig:integer, signed, unsigned, std_logic_vector conv_integer(asig): convert asig to integer conv_unsigned(asig,n): convert asig to n-bit unsigned conv_signed(asig,n): convert asig to n-bit signed conv_std_logic_vector(asig,n):convert asig to n-bit std_logic_vector
24 Pretvorba med tipi: v vektor conv_std_logic_vector(arg: integer, size: integer) return std_logic_vector; conv_std_logic_vector(arg: unsigned, size: integer) return std_logic_vector; conv_std_logic_vector(arg: signed, size: integer) return std_logic_vector;
25 Pretvorba med tipi: natural v unsigned library ieee; use ieee.std_logic_arith.all; use ieee.std_logc_1164.all; entity conversion_demo is port(value_i : in natural range 0 to 255; result_o : out unsigned(7 downto 0) ); end; architecture behavior of conversion_demo is begin result_o <= conv_unsigned(value_i,result_o length); end;
26 Pretvora med tipi: v signed in unsigned Poleg conv Iz vektorja: signed(arg: std_logic_vector) return signed; unsigned(arg: std_logic_vector) return unsigned; Iz integerja: to_unsigned(arg: integer, size: integer) return unsigned; to_signed(arg: integer, size: integer) return signed;
27 Pretvorba med tipi: vektor v unsigned library ieee; use ieee.std_logic_arith.all; use ieee.std_logc_1164.all; entity conversion_demo is port(value_i : in std_logic_vector(7 downto 0); result_o : out unsigned(7 downto 0) ); end; architecture behavior of conversion_demo is begin result_o <= unsigned(value_i); end;
28 Pretvora med tipi: integer Poleg conv to_integer(arg) return integer;
29 Povečevanje obsega library ieee; use ieee.std_logic_arith.all; use ieee.std_logc_1164.all; entity unsigned_resize_larger is port(a_i : in unsigned(7 downto 0); z_o : out unsigned(15 downto 0) ); end; architecture behavior of unsigned_resize_larger is begin z_o <= conv_unsigned(a_i, 16); end; msb lsb
30 Povečevanje obsega library ieee; use ieee.std_logic_arith.all; use ieee.std_logc_1164.all; entity signed_resize_larger is port(a_i : in signed(7 downto 0); z_o : out signed(15 downto 0) ); end; architecture behavior of signed_resize_larger is begin z_o <= conv_signed(a_i, 16); end; msb lsb
31 Povečevanje obsega library ieee; use ieee.std_logic_arith.all; use ieee.std_logc_1164.all; entity signed_resize_larger is port(a_i : in signed(7 downto 0); z_o : out signed(15 downto 0) ); end; architecture behavior of signed_resize_larger is begin z_o <= conv_signed(a_i, z_o'length); end; msb lsb
32 Zmanjševanje obsega library ieee; use ieee.std_logic_arith.all; use ieee.std_logc_1164.all; entity signed_resize_smaller is port(a_i : in unsigned(15 downto 0); z_o : out unsigned(7 downto 0) ); end; architecture behavior of unsigned_resize_smaller is begin z_o <= conv_unsigned(a_i, 8); end; msb lsb
33 Zmanjševanje obsega library ieee; use ieee.std_logic_arith.all; use ieee.std_logc_1164.all; entity signed_resize_smaller is port(a_i : in signed(15 downto 0); z_o : out signed(7 downto 0) ); end; architecture behavior of signed_resize_smaller is begin z_o <= conv_signed(a_i, 8); end; msb lsb
34 Operacije nad števili Primerjanje števil: =, /=, <, <=, >, >= Aritmetične operacije: +, - *, abs Bitne operacije: AND, OR, NOT Konkatenacija: & Lastna izvedba množilnikov bolj priporočljiva! Operatorjev kot so **, / in mod se v splošnem ne da sintetizirati Deluje le pri deljenju s potenco števila 2.
35 Različne kombinacije SIGNED + INTEGER return SIGNED SIGNED + NATURAL return SIGNED UNSIGNED + INTEGER return UNSIGNED UNSIGNED + NATURAL return UNSIGNED UNSIGNED + SIGNED ni dovoljeno Eksplicitna pretvorba s funkcijami iz prejšnjih prosojnic
36 Različne kombinacije Signal A_uv, B_uv, C_uv, D_uv, E_uv : unsigned(7 downto 0) ; Signal R_sv, S_sv, T_sv, U_sv, V_sv : signed(7 downto 0) ; Signal J_slv, K_slv, L_slv : std_logic_vector(7 downto 0) ; signal Y_sv : signed(7 downto 0) ; A_uv <= B_uv + C_uv ; -- Unsigned + Unsigned = Unsigned D_uv <= B_uv + 1 ; -- Unsigned + Integer = Unsigned E_uv <= 1 + C_uv; -- Integer + Unsigned = Unsigned R_sv <= S_sv + T_sv ; -- Signed + Signed = Signed U_sv <= S_sv + 1 ; -- Signed + Integer = Signed V_sv <= 1 + T_sv; -- Integer + Signed = Signed J_slv <= K_slv + L_slv ; -- if using std_logic_unsigned -- Illegal Cannot mix different array types Y_sv <= A_uv - B_uv; -- want signed result
37 Seštevanje nepredznačenih števil (neupoštevanje preliva) library ieee ; use ieee.std_logic_1164.all ; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all ; entity adder_unsigned is port( a : in STD_LOGIC_VECTOR(1 downto 0); b : in STD_LOGIC_VECTOR(1 downto 0); sum : out STD_LOGIC_VECTOR(1 downto 0)); end adder_unsigned; architecture arch of adder_unsigned is begin sum <= a + b; end arch; Zaradi uporabe knjižnice std_logic_unsigned uporaba posebnih tipov ni potrebna!
38 Seštevanje predznačenih števil (upoštevanje preliva) library ieee ; use ieee.std_logic_1164.all ; use ieee.std_logic_arith.all; use ieee.std_logic_signed.all ; entity adder_signed is port( a : in STD_LOGIC_VECTOR(1 downto 0); b : in STD_LOGIC_VECTOR(1 downto 0); sum : out STD_LOGIC_VECTOR(2 downto 0)); end adder_signed; architecture arch of adder_signed is begin sum <= (a(1) & a) + (b(1) & b); end arch; Zaradi uporabe knjižnice std_logic_signed uporaba posebnih tipov ni potrebna!
39 Aritmetično logična enota (ALE) Arithmetic Logic Unit (ALU) Aritmetične operacije: npr. seštevanje in odštevanje Logične operacije: npr. logične funkcije in pomikanje podatkov
40 74181 Kombinatorno vezje za izvedbo aritmetično-logičnih operacij. Priključki: A,B: podatkovna vhoda F: podatkovni izhod C n+4 : prenos na najvišjem mestu A=B: enakost vhodov M: kontrolni vhod, ki določa tip operacije M=0: aritmetične M=1: logične S: kontrolni vhodi, ki določajo konkretno operacijo Izvedba 48 različnih operacij.
41 74181
42 74181
43 74181 Invertirani izhodi: kako se izognemo uporabi negatorjev na vhodih in izhodih? Pri logičnih funkcijah uporabljamo dualno funkcijo: Primer:
44 74181 Seštevanje: kako se izognemo uporabi negatorjev na vhodih in izhodih? Pri seštevanju negiramo C n in C n+4. Primer: seštevanje dveh števil seštevanje dveh števil s (S=1001) 'C n 'C n
45 Seštevanje: 74181
46 74181 Odštevanje: kako se izognemo uporabi negatorjev na vhodih in izhodih? Invertirati moramo le izhodni prenos (C n+4 )! Primer: Odštevanje dveh števil odštevanje dveh števil s (-2 10 ) C n C n (S=0110) Če damo na vhod 0, se odšteje 1 in obratno (glej tabelo) C n
47 Primer 1: ALE v VHDL library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity ALU_VHDL is port ( number1_i, number2_i: in std_logic_vector(3 downto 0); op_i: in std_logic_vector(2 downto 0); carry_o : out std_logic; flag_o : out std_logic; result_o : out std_logic_vector(3 downto 0) ); end entity ALU_VHDL; architecture Behavioral of ALU_VHDL is signal temp: std_logic_vector(4 downto 0); begin...
48 process(number1_i, number2_i, op_i) is begin flag_o <= '0'; carry_o <= '0'; case op_i is when "000" => -- res = num1 + num2 temp <= std_logic_vector((unsigned('0' & number1_i) + unsigned(number2_i))); result <= temp(3 downto 0); carry_o <= temp(4); when "001" => -- res = num1 - num2, flag = 1 if num2 > num1 if (number1_i >= number2_i) then result <= std_logic_vector(unsigned(number1_i) - unsigned(number2_i)); flag <= '0'; else result <= std_logic_vector(unsigned(number2_i) - unsigned(number1_i)); flag <= '1'; end if; when "010" => result <= number1_i and number2_i; when "011" => result <= number1_i or number2_i; when "100" => result <= number1_i xor number2_i; when "101" => result <= not number1_i; when "110" => result <= not number2_i; when others => -- res = num1 + num2 + 1 temp <= std_logic_vector((unsigned('0' & number1_i) + unsigned(number2_i)) + 1); result <= temp(3 downto 0); carry_o <= temp(4); end case; end process; end architecture Behavioral;
49 Primer 2: ALE v VHDL library IEEE; use IEEE. STD_LOGIC_1164. ALL; use IEEE. STD_LOGIC_ARITH. ALL; use IEEE. STD_LOGIC_UNSIGNED. ALL; entity ale is Generic ( data_width : integer := 8 ); Port ( data_a_i : in STD_LOGIC_VECTOR ( data_width -1 downto 0); data_b_i : in STD_LOGIC_VECTOR ( data_width -1 downto 0); alu_op_i : in STD_LOGIC_VECTOR (2 downto 0); data_o : out STD_LOGIC_VECTOR ( data_width -1 downto 0) ); end ale;
50 Primer ALE v VHDL architecture Behavioral of ale is constant c_alu_op_add : std_logic_vector(2 downto 0) := "000"; constant c_alu_op_sub : std_logic_vector(2 downto 0) := "001"; constant c_alu_op_and : std_logic_vector(2 downto 0) := "010"; constant c_alu_op_or : std_logic_vector(2 downto 0) := "011"; constant c_alu_op_xor : std_logic_vector(2 downto 0) := "100"; begin with alu_op_i select data_o <= data_a_i + data_b_i when c_alu_op_add, data_a_i - data_b_i when c_alu_op_sub, data_a_i and data_b_i when c_alu_op_and, data_a_i or data_b_i when c_alu_op_or, data_a_i xor data_b_i when c_alu_op_xor, 0 when others ; end Behavioral;
RAČUNALNIŠKA ARHITEKTURA
RAČUNALNIŠKA ARHITEKTURA 5 Operandi RA - 5 2017, Igor Škraba, FRI Predstavitev informacije - vsebina 5 Operandi - vsebina Sestavljeni pomnilniški operandi Osnovni tipi informacije v računalniku Predstavitev
More informationECEU530. Homework 2. ECE U530 Digital Hardware Synthesis. Homework 2: Waveforms. Debugging VHDL
ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu October 4, 2006 Lecture 8: Homework 2 -- due Thursday October 5 by 2pm Projects Homework 3 VHDL arithmetic Reading: Sections 4.1,
More informationVHDLPrimeri Poglavlje5.doc
5. VHDL opis kola koja obavljaju osnovne aritmetičke funkcije Sabirači Jednobitni potpuni sabirač definisan je tablicom istinitosti iz Tabele 5.1. Tabela 5.1. cin a b sum cout 0 0 0 0 0 0 0 1 1 0 0 1 0
More informationVery High Speed Integrated Circuit Har dware Description Language
Very High Speed Integrated Circuit Har dware Description Language Industry standard language to describe hardware Originated from work in 70 s & 80 s by the U.S. Departm ent of Defence Root : ADA Language
More informationBasic Language Constructs of VHDL
Basic Language Constructs of VHDL Chapter 3 1 Outline 1. Basic VHDL program 2. Lexical elements and program format 3. Objects 4. Data type and operators Chapter 3 2 1. Basic VHDL program Chapter 3 3 Design
More informationLecture 38 VHDL Description: Addition of Two [5 5] Matrices
Lecture 38 VHDL Description: Addition of Two [5 5] Matrices -- First, write a package to declare a two-dimensional --array with five elements library IEEE; use IEEE.STD_LOGIC_1164.all; package twodm_array
More informationHardware Modeling. VHDL Basics. ECS Group, TU Wien
Hardware Modeling VHDL Basics ECS Group, TU Wien VHDL Basics 2 Parts of a Design Unit Entity Architecture Configuration Package Package Package Body Library How to create a Design Unit? Interface to environment
More informationLecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1
Lecture 1: VHDL Quick Start Digital Systems Design Fall 10, Dec 17 Lecture 1 1 Objective Quick introduction to VHDL basic language concepts basic design methodology Use The Student s Guide to VHDL or The
More information5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.
Filename= ch5.doc 5. 0 VHDL OPERATORS There are seven groups of predefined VHDL operators: 1. Binary logical operators: and or nand nor xor xnor 2. Relational operators: = /= < >= 3. Shifts operators:
More informationTehnike programiranja PREDAVANJE 9 Uvod v binarni svet in računalništvo
Tehnike programiranja PREDAVANJE 9 Uvod v binarni svet in računalništvo Predavanje 9 Uvod v binarni svet Birnarna aritmetika Polprevodniške tehnologije Računalnik Mikroprocesor ldos.fe.uni-lj.si >študij
More informationChapter 6 Combinational-Circuit Building Blocks
Chapter 6 Combinational-Circuit Building Blocks Commonly used combinational building blocks in design of large circuits: Multiplexers Decoders Encoders Comparators Arithmetic circuits Multiplexers A multiplexer
More informationECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University
ECE 545 Lecture 8 Data Flow Description of Combinational-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 7, Combinational Circuit Design:
More informationCOVER SHEET: Total: Regrade Info: 1 (8 points) 2 ( 8 points) 3 (16 points) 4 (16 points) 5 (16 points) 6 (16 points) 7 (16 points) 8 (8 points)
EEL 4712 Midterm 1 Spring 2010 VERSION 1 Name: UFID: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer
More informationEsempio FSM Description : library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity esempiofsm is port ( clk: in STD_LOGIC; p: in STD_LOGIC; reset:
More informationBASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS. Lecture 7 & 8 Dr. Tayab Din Memon
BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS Lecture 7 & 8 Dr. Tayab Din Memon Outline Data Objects Data Types Operators Attributes VHDL Data Types VHDL Data Objects Signal Constant Variable File VHDL Data
More informationMetode logičnega snovanja Programabilne logične naprave in VHDL. Miha Moškon
Metode logičnega snovanja Programabilne logične naprave in VHDL Miha Moškon Programabilne logične naprave Metode logičnega snovanja, 1. laboratorijska vaja 2 Programabilna logična vezja V času proizvodnje
More informationConstructing VHDL Models with CSA
Constructing VHDL Models with CSA List all components (e.g., gate) inclusive propagation delays. Identify input/output signals as input/output ports. All remaining signals are internal signals. Identify
More informationECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level
More informationECOM 4311 Digital Systems Design
ECOM 4311 Digital Systems Design Eng. Monther Abusultan Computer Engineering Dept. Islamic University of Gaza Page 1 Agenda 1. Counters Page 2 Counters - special name of any clocked sequential circuit
More informationVHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit.
VHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit. Its main applications include synthesis of digital circuits onto CPLD/FPGA (Complex Programmable
More informationVHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents
VHDL Testbench Tutorial 1 Contents 1 VHDL Testbench 2 Test Bench Syntax 3 Testbench Example: VHDL Code for Up Down Binary Counter 4 VHDL Testbench code for up down binary counter 5 Testbench Waveform for
More informationLecture 3: Basic Adders and Counters
Lecture 3: Basic Adders and Counters ECE 645 Computer Arithmetic /5/8 ECE 645 Computer Arithmetic Lecture Roadmap Revisiting Addition and Overflow Rounding Techniques Basic Adders and Counters Required
More informationECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level
More informationDesign a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Output Sum(4 bits) Adder. Output carry(1 bit)
Csc 343 Lab 2 Sep 28. 07 Objective: Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Structure: Input A (4 bits) Input B (4 bit) Adder Output Sum(4 bits) Output carry(1 bit) input cin
More informationReview. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;
LIBRARY list of library names; USE library.package.object; Review ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type; signal_name(s) : mode signal_type); END ENTITY entity_name;
More informationDesign units can NOT be split across different files
Skeleton of a Basic VHDL Program This slide set covers the components to a basic VHDL program, including lexical elements, program format, data types and operators A VHDL program consists of a collection
More informationVHDL: Code Structure. 1
VHDL: Code Structure talarico@gonzaga.edu 1 Mo:va:on for HDL- based design Standard Technology/vendor independent Portable and Reusable talarico@gonzaga.edu 2 Altera s Design Flow (RTL) RTL Generic Boolean
More informationVHDL for Complex Designs
ELEC 379 : DESIGN OF DIGITAL AND MICROCOMPUTER SYSTEMS 1998/99 WINTER SESSION, TERM 2 VHDL for Complex Designs This lecture covers VHDL features that are useful when designing complex logic circuits. After
More informationIntroduction to VHDL #1
ECE 3220 Digital Design with VHDL Introduction to VHDL #1 Lecture 3 Introduction to VHDL The two Hardware Description Languages that are most often used in industry are: n VHDL n Verilog you will learn
More informationINTRODUCTION TO VHDL ADVANCED COMPUTER ARCHITECTURES. Slides by: Pedro Tomás. Additional reading: - ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC)
INTRODUCTION TO VHDL Slides by: Pedro Tomás Additional reading: - ADVANCED COMPUTER ARCHITECTURES ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC) Outline 2 Hardware Description Languages (HDL) VHDL Very
More informationEEE8076. Reconfigurable Hardware Design (coursework) Module Outline. Dr A. Bystrov Dr. E.G. Chester. Autumn
EEE8076 Reconfigurable Hardware Design (coursework) Module Outline Dr A. Bystrov Dr. E.G. Chester Autumn 2010 1 2 3 4 5 6 7 8 9 10 11 12 Altera UP2 development board, Flex EPF10K70 FPGA www.altera.com/literature/univ/upds.pdf
More informationQ: Do You made a backup before upgrade? A: Only cowards make backups!
Q: Do You made a backup before upgrade? You z malo - you A: Only cowards make backups! Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.
More informationVHDL Packages for Synthesis Base Types Standard bit types may be used Typically IEEE 1164 Std. types are used. CPE 528: Session #9
CPE 528: Session #9 Department of Electrical and Computer Engineering University of Alabama in Huntsville VHDL Packages for Synthesis Base Types Standard bit types may be used Typically IEEE 1164 Std.
More informationTSIU03, SYSTEM DESIGN LECTURE 2
LINKÖPING UNIVERSITY Department of Electrical Engineering TSIU03, SYSTEM DESIGN LECTURE 2 Mario Garrido Gálvez mario.garrido.galvez@liu.se Linköping, 2018 1 From 1bit to several bits. TODAY - Review of
More informationDeclarations of Components and Entities are similar Components are virtual design entities entity OR_3 is
Reserved Words component OR_3 port (A,B,C: in bit; Z: out bit); end component ; Reserved Words Declarations of Components and Entities are similar Components are virtual design entities entity OR_3 is
More informationBasic Language Concepts
Basic Language Concepts Sudhakar Yalamanchili, Georgia Institute of Technology ECE 4170 (1) Describing Design Entities a sum b carry Primary programming abstraction is a design entity Register, logic block,
More informationCMPT 250: Computer Architecture. Using LogicWorks 5. Tutorial Part 1. Somsubhra Sharangi
CMPT 250: Computer Architecture Using LogicWorks 5 Tutorial Part 1 Somsubhra Sharangi What is VHDL? A high level language to describe digital circuit Different that a programming language ( such as Java)
More informationUDF for volume calculation with the use of NTF method. Lastne Excel funkcije za izračun prostornin po NTF metodi
RMZ Materials and Geoenvironment, Vol. 54, No. 3, pp.419-425, 2007 419 UDF for volume calculation with the use of NTF method Lastne Excel funkcije za izračun prostornin po NTF metodi Mi l i v o j Vu l
More informationLattice VHDL Training
Lattice Part I February 2000 1 VHDL Basic Modeling Structure February 2000 2 VHDL Design Description VHDL language describes a digital system as a set of modular blocks. Each modular block is described
More informationReview of Digital Design with VHDL
Review of Digital Design with VHDL Digital World Digital world is a world of 0 and 1 Each binary digit is called a bit Eight consecutive bits are called a byte Hexadecimal (base 16) representation for
More informationTri-State Bus Implementation
Tri-State Bus Implementation Danny Mok Altera HK FAE (dmok@altera.com) Sample Code library ieee; use ieee.std_logic_1164.all; library lpm; use lpm.lpm_components.all; entity tri_bus is port (a,b : in std_logic_vector(7
More informationLANGUAGE VHDL FUNDAMENTALS
LANGUAGE VHDL FUNDAMENTALS Introduction Entities and architectures Sentences and processes Objects Data types and operands Authors: Luis Entrena Arrontes, Celia López, Mario García, Enrique San Millán,
More informationDelavnica za konfiguriranje dostopovnih točk WEB konfiguracija LANCOM L-54
Delavnica za konfiguriranje dostopovnih točk WEB konfiguracija LANCOM L-54 Boštjan Lemut Prva povezava na L-54 s povezovalnim kablom povežemo mrežna vmesnika na računalniku in L-54 v brskalniku vpišemo
More informationSynthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden
Synthesis from VHDL Krzysztof Kuchcinski Krzysztof.Kuchcinski@cs.lth.se Department of Computer Science Lund Institute of Technology Sweden March 23, 2006 Kris Kuchcinski (LTH) Synthesis from VHDL March
More informationDB2 podatkovna baza v praksi
DB2 podatkovna baza v praksi Aljoša Trivan, Mikropis holding d.o.o. aljosa.trivan@mikropis.si 2007 IBM Corporation Agenda Mikropis Splošno Fleksibilnost Vzdrževanje Backup SQL objekti in SQL stavki Novosti
More information!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"
!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"!!"#$%&'#()#*+"+#,-."/0110#230#4."50",+"+#)6# 6+-+#(.6+-0#)4475.8)60#0/#.65-0#230#9+**+"+# 2.48).-0#(.6+-0#! 2+"*5."5*:#,."/0110#;)**0! *),".6*:#-.99-0*0"5."+#2+660,.40"5)#;)*)2)#
More informationProgramski jezik Java
Programski jezik Java Interno gradivo za predmet Algoritmi in programski jeziki (4. letnik) ArrayList (neprečiščeno besedilo) ArrayList Java class ArrayList(java.util.ArrayList) je hiter in za uporabo
More informationDesign Guidelines for Using DSP Blocks
Design Guidelines for Using DSP Blocks in the Synplify Software April 2002, ver. 1.0 Application Note 193 Introduction Altera R Stratix TM devices have dedicated digital signal processing (DSP) blocks
More informationSolutions - Homework 2 (Due date: October 9:30 am) Presentation and clarity are very important!
ECE-8L: Computer Logic Design Fall Solutions - Homework (Due date: October rd @ 9: am) Presentation and clarit are ver important! PROBLEM ( PTS) Complete the following table. Use the fewest number of bits
More informationSummary of basic structures
VHDL Summary of basic structures René Beuchat rene.beuchat@epfl.ch rene.beuchat@hesge.ch 1 Resume Lexical elements Reserved words Declarations Type declaration Subtype declaration Constant declaration
More informationIP PACKET QUEUING DISCIPLINES AS BASIC PART OF QOS ASSURANCE WITHIN THE NETWORK
UDK621.3:(53+54+621 +66), ISSN0352-9045 Informacije MIDEM 39(2009)2, Ljubljana IP PACKET QUEUING DISCIPLINES AS BASIC PART OF QOS ASSURANCE WITHIN THE NETWORK Sasa Klampfer, Joze Mohorko, Zarko Cucej University
More informationVHDL par Ahcène Bounceur VHDL
VHDL Ahcène Bounceur 2009 Plan de travail 1. Introduction au langage 2. Prise en main 3. Machine à état 4. Implémentation sur FPGA 1 VHDL Introduction au langage Ahcène Bounceur VHDL VHIC (Very High-speed
More informationLogic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs
Logic and Computer Design Fundamentals VHDL Part Chapter 4 Basics and Constructs Charles Kime & Thomas Kaminski 24 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Overview
More informationCSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\
CSCI 250 - Lab 3 VHDL Syntax Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\ Objectives 1. Learn VHDL Valid Names 2. Learn the presentation of Assignment and Comments 3. Learn Modes, Types, Array,
More informationSintaksa VHDL jezika - podsjetnik -
Sintaksa VHDL jezika - podsjetnik - -- Učitavanje biblioteka library ; -- Import all the declarations in a package use ..all; -- Import a specific declaration
More informationVHDL: skaitmeninių įtaisų projektavimo kalba. 2 paskaita Pradmenys
VHDL: skaitmeninių įtaisų projektavimo kalba 2 paskaita Pradmenys Skeleton of a Basic VHDL Program This slide set covers the components to a basic VHDL program, including lexical elements, program format,
More informationOsnove programskega jezika C++
Osnove programskega jezika C++ 1 O S N O V E P R O G R A M I R A N J A V C + + U P O R A B A P R O G R A M A CODE::B L O C K S programski stavek Nekaj osnovnih pojmov (1.) definicija, deklaracija, ukaz
More informationVHDL BASIC ELEMENTS INTRODUCTION
VHDL BASIC ELEMENTS INTRODUCTION VHDL Basic elements Identifiers Basic identifiers Extended identifiers Data Objects Constant Variable Signal File Data Types Scalar Composite Access File type Identifiers
More informationIntroduction to VHDL
Introduction to VHDL Agenda Introduce VHDL Basic VHDL constructs Implementing circuit functions Logic, Muxes Clocked Circuits Counters, Shifters State Machines FPGA design and implementation issues FPGA
More informationDesign Guidelines for Using DSP Blocks
Design Guidelines for Using DSP Blocks in the LeonardoSpectrum Software April 2002, ver. 1.0 Application Note 194 Introduction Altera R Stratix TM devices have dedicated digital signal processing (DSP)
More informationVHDL And Synthesis Review
VHDL And Synthesis Review VHDL In Detail Things that we will look at: Port and Types Arithmetic Operators Design styles for Synthesis VHDL Ports Four Different Types of Ports in: signal values are read-only
More informationPrirejanje in preverjanje tipov
Uvod v C# Drugi del Dedovanje Sintaksa Prirejanje in preverjanje tipov Kaste preverjenih tipov Prekrivanje metod Dinamično povezovanje (poenostavljeno) Skrivanje Dinamično povezovanje (s skrivanjem) Fragile
More informationSession:E07 GALIO - DB2 index advisor, how we implemented it and what we get from self-made expert tool
Session:E07 GALIO - DB2 index advisor, how we implemented it and Viktor Kovačević, MSc Hermes Softlab 6th October 2009 14:15 (60') Platform: UDB / LUW OUTLINE Application & Database tuning Self made index
More informationECOM4311 Digital Systems Design
ECOM 4311 Digital Systems Design Eng. Monther Abusultan Computer Engineering Dept. Islamic University of Gaza Page 1 Agenda 1. VHDL : Data Types Cont d 2. VHDL : Operators 3. VHDL : Signal Assignments
More informationVHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2
VHDL: Modeling RAM and Register Files Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2 Memory Synthesis Approaches: Random logic using flip-flops or latches Register files in datapaths RAM standard components
More informationContents. Appendix D VHDL Summary Page 1 of 23
Appendix D VHDL Summary Page 1 of 23 Contents Appendix D VHDL Summary...2 D.1 Basic Language Elements...2 D.1.1 Comments...2 D.1.2 Identifiers...2 D.1.3 Data Objects...2 D.1.4 Data Types...2 D.1.5 Data
More informationFPGA Design. Part III - Combinatorial VHDL. Thomas Lenzi
FPGA Design Part III - Combinatorial VHDL Thomas Lenzi Objective We will introduce you to VHDL and to combinatorial statements of VHDL using some examples and exercises. 2 VHDL Basics Few Notes on VHDL
More informationCprE 583 Reconfigurable Computing
Recap Moore FSM Example CprE / ComS 583 Reconfigurable Computing Moore FSM that recognizes sequence 10 0 1 0 1 S0 / 0 S1 / 0 1 S2 / 1 Prof. Joseph Zambreno Department of Electrical and Computer Engineering
More informationVHDL 3 BASIC OPERATORS AND ARCHITECTURE BODY. Design descriptions & design constructions examples are taken from foundation series examples
1 VHDL 3 BASIC OPERATORS AND ARCHITECTURE BODY Design descriptions & design constructions examples are taken from foundation series examples 2 What we have done in Lab 1 entity AND_Gate is port ( a : in
More informationONE-DIMENSIONAL CUTTING STOCK OPTIMIZATION: THE CASE OF A LOW RATIO BETWEEN STOCK AND ORDER LENGTHS MIRO GRADIŠAR
ONE-DIMENSIONAL CUTTING STOCK OPTIMIZATION: THE CASE OF A LOW RATIO BETWEEN STOCK AND ORDER LENGTHS MIRO GRADIŠAR Faculty of Economics, University of Ljubljana, 1000 Ljubljana, Kardeljeva ploscad 17, Slovenia,
More informationformati slike in branje slike pomen in nekaj primerov EM spekter aplikacije v posameznih delih spektra o matriki slike
Strojni vid pri tehnoloških meritvah formati slike in branje slike pomen in nekaj primerov EM spekter aplikacije v posameznih delih spektra o matriki slike formati slike in branje slike slika je običajno
More informationDelavnica za konfiguriranje dostopovnih točk Konfiguracija LANCOM L-54 z uporabo orodja LANConfig
Delavnica za konfiguriranje dostopovnih točk Konfiguracija LANCOM L-54 z uporabo orodja LANConfig Boštjan Lemut Prva povezava na L-54 s povezovalnim kablom povežemo mrežna vmesnika na računalniku in L-54
More informationECE 545 Lecture 12. FPGA Resources. George Mason University
ECE 545 Lecture 2 FPGA Resources George Mason University Recommended reading 7 Series FPGAs Configurable Logic Block: User Guide Overview Functional Details 2 What is an FPGA? Configurable Logic Blocks
More informationDigital System Construction
Digital System Construction FYSIKUM Lecture 4: More VHDL, memory, PRNG Arithmetic Memories Pipelines and buffers Pseudorandom numbers IP core generation in Vivado Introduction to Lab 3 Digital Systemkonstruktion
More informationVHDL in 1h. Martin Schöberl
VHDL in 1h Martin Schöberl VHDL /= C, Java, Think in hardware All constructs run concurrent Different from software programming Forget the simulation explanation VHDL is complex We use only a small subset
More informationProblem Solutions (*) (*) Details about the physical circuits, codes, and binary algebra can be found in reference [1] below.
Circuit Design with VHDL Volnei A. Pedroni MIT Press Aug. 2004 Problem Solutions (*) (*) Details about the physical circuits, codes, and binary algebra can be found in reference [1] below. [1] V. A. Pedroni,
More informationAdvanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009
2065-15 Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis 26 October - 20 November, 2009 FPGA Architectures & VHDL Introduction to Synthesis Nizar Abdallah ACTEL Corp.2061
More informationFPGA.
CMOS TTL Verilog VHDL mshora@yahoo.com 7400. NAND CMOS TTL 1 0 source sink datasheet bounce bounce debunce RS Latch debounce Typical Characteristics NO NC Semiconductor Material Wavelength Colour V F @
More information... ; ako je a n parno. ; ako je a n neparno
Zadaci vezani za ciklus sa preduslovom (WHILE) Zad. Napisati program za izračunavanje n_tog stepena broja a. Zad2. Napisati program za izračunavanje sume S kvadrata parnih i kubova neparnih prirodnih brojeva
More informationECE 545 Lecture 4. Simple Testbenches. George Mason University
ECE 545 Lecture 4 Simple Testbenches George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 2.2.4, Testbenches 2 Testbenches ECE 448 FPGA and ASIC Design with VHDL 3 Testbench
More informationGetting Started with VHDL
Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component Entities can be primitive objects or complex objects Architectures are associated
More informationLecture 4. VHDL Fundamentals. George Mason University
Lecture 4 VHDL Fundamentals George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 3, Basic Language Constructs of VHDL 2 Design Entity ECE 448 FPGA and ASIC Design with
More informationOutline CPE 626. Advanced VLSI Design. Lecture 4: VHDL Recapitulation (Part 2) Signals. Variables. Constants. Variables vs.
CPE 626 Lecture 4: VHDL Recapitulation (Part 2) Aleksandar Milenkovic http://www.ece.uah.edu/~milenka http://www.ece.uah.edu/~milenka/cpe626-04f/ milenka@ece.uah.edu Assistant Professor Electrical and
More information310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006
310/1780-10 ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006 VHDL & FPGA - Session 2 Nizar ABDALLH ACTEL Corp. 2061 Stierlin Court
More informationECE 545 Lecture 9. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. George Mason University
ECE 545 Lecture 9 Modeling of Circuits with a Regular Structure Aliases, Attributes, Packages George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapters 14.5 For Generate
More informationVHDLPrimeri Poglavlje3.doc. end process seq; Slika 3.1: Anatomija osnovne definicije test bench-a
3. Verifikacija projekta - Test bench entity TestBench is end entity TestBench; architecture TB_Arhitektura of TestBench is component UUT (Arhitektura_UUT) port( end component UUT; prazan entitet -- deklarisanje
More informationECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University
ECE 545 Lecture 5 Data Flow Modeling in VHDL George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 4, Concurrent Signal Assignment Statements of VHDL 2 Types of VHDL Description
More informationIntroduction to VHDL. Main language concepts
Introduction to VHDL VHSIC (Very High Speed Integrated Circuit) Hardware Description Language Current standard is IEEE 1076-1993 (VHDL-93). Some tools still only support VHDL-87. Tools used in the lab
More informationconstant reg_init: std_logic_vector(11 downto 0):=" ";
-- UART Package Declaration -- -- by Weijun Zhang, 05/2001 library ieee; use ieee.std_logic_1164.all; package my_package is FUNCTION parity(inputs: std_logic_vector(7 downto 0)) RETURN std_logic; end my_package;
More informationField Programmable Gate Array
Field Programmable Gate Array System Arch 27 (Fire Tom Wada) What is FPGA? System Arch 27 (Fire Tom Wada) 2 FPGA Programmable (= reconfigurable) Digital System Component Basic components Combinational
More informationDIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3
DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3 BEHAVIORAL DESCRIPTION Asynchronous processes (decoder, mux, encoder, etc): if-else, case, for-loop. Arithmetic expressions inside asynchronous processes.
More information» Nakup in vzdrževanje Oracle programske opreme «Tehnične specifikacije
Obrazec P-5 Specifikacije 30K250316» Nakup in vzdrževanje Oracle programske opreme «Tehnične specifikacije KAZALO VSEBINE 1. Predmet javnega naročila...3 1.1. SKLOP-1: STORITEV VZDRŽEVANJA ORACLE LICENČNE
More informationAssignment 01 Computer Architecture Lab ECSE
Assignment 01 Computer Architecture Lab ECSE 487-001 Date due: September 22, 2006, Trottier Assignment Box by 14:30 1 Introduction The purpose of this assignment is to re-familiarize the student with VHDL
More informationHitra rast hranjenih podatkov
Tomaž Borštnar - član uredništva računalniške revije Monitor od začetka (oktober 1991; ne-pc okolja (Unix, etc) - sodelavec YUNAC in ARNES od začetka - postavil in upravljal večino strežnikov na SiOL -
More informationEEL 4712 Digital Design Test 1 Spring Semester 2007
IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. COVER SHEET: Problem: Points: 1 (15 pts) 2 (20 pts) Total 3 (15 pts) 4 (18 pts)
More informationVHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit
VHDL VHDL Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit VHDL Alternative (Student Generated) Definition Very Hard Digital Logic language VHDL Design
More informationVodnik skozi Google Analytics Beta verzija 1. del. prehod s stare kode (urchin.js), k novi kodi za sledenje (ga.js)
Vodnik skozi Google Analytics Beta verzija 1. del prehod s stare kode (urchin.js), k novi kodi za sledenje (ga.js) Ta vodnik je povzetek Googe vodiča ' Tracking Code Migration Guide Switching from urchin.js
More informationECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University
ECE 545 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 5.1, VHDL Process Chapter 8, Sequential
More informationFile: /home/young/mywork/5.cordic_vhdl/a.beh/print.cordic_beh Page 1 of 10
File: /home/young/mywork/5.cordic_vhdl/a.beh/print.cordic_beh Page 1 of 10.SUFFIXES :.o.vhdl.vhdl.o : ghdl -a $< cordic_tb : cordic_pkg.o cordic_beh.o cordic_tb.o ghdl -e cordic_tb anal : cordic_pkg.o
More informationVHDL Simulation. Testbench Design
VHDL Simulation Testbench Design The Test Bench Concept Elements of a VHDL/Verilog testbench Unit Under Test (UUT) or Device Under Test (DUT) instantiate one or more UUT s Stimulus of UUT inputs algorithmic
More information