Home - Rasfoiesc.com
Educatie Sanatate Inginerie Business Familie Hobby Legal
Satisfactia de a face ce iti place. tutorial, lectii online, solutii simple, exmeple, programe, C++

Biologie Chimie Didactica Fizica Geografie Informatica
Istorie Literatura Matematica Psihologie

C


Index » educatie » » informatica » C
Adunarea in Xlininx


Adunarea in Xlininx


Adunare

Codul

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

---- Uncomment the following library declaration if instantiating

---- any Xilinx primitives in this code.

--library UNISIM;

--use UNISIM.VComponents.all;

entity adunare is

port (A,B:in std_logic_vector (3 downto 0 ) ; -- doua intr?ri de cate 4 biti

CIN:in std_logic; -- intrarea de transport

C: out std_logic_vector (3 downto 0) ; --? rezultatul pe 4 biti

CAR_OUT :out std_logic ); --? ie?irea de transport

end adunare;

architecture Behavioral of adunare is

begin

P1:process(A,B,CIN)

variable PADDED_CIN: std_logic_vector (3 downto 0);

variable A_UNSIGNED: UNSIGNED(3 downto 0);

variable C_UNSIGNED: UNSIGNED(4 downto 0);

variable temp: std_logic_vector(4 downto 0);

begin

A_UNSIGNED := UNSIGNED(A);

PADDED_CIN := '000'&CIN ; --? concatenarea lui CIN cu 000

C_UNSIGNED := CONV_UNSIGNED(A_UNSIGNED,5 ) + UNSIGNED(B) +

UNSIGNED(PADDED_CIN);

C <= CONV_STD_LOGIC_VECTOR (C_UNSIGNED,4) ;

temp := CONV_STD_LOGIC_VECTOR (C_UNSIGNED,5); ---- se ob?ine din C_UNSIGNED

CAR_OUT <= temp(4);

end process;

end Behavioral;

Afisarea rezultatelor simularii






Politica de confidentialitate
C


Access
Adobe photoshop
Autocad
Baze de date
C
Calculatoare
Corel draw
Excel
Foxpro
Html
Internet
Java
Linux
Mathcad
Matlab
Outlook
Pascal
Php
Powerpoint
Retele calculatoare
Sql
Windows
Word

Controale de tip lista
EXPRESII SI INSTRUCTIUNI
Cod VHDL pentru setul de registre - laborator
Constructori
Sumator pe n biti - Codul programabil
Tablouri Creare. Initializare. Afisare. Stergere. Metode de cautare. Metode de sortare.
Clase prietene
COMPONENTELE MEDIULUI INTEGRAT C++ BUILDER
OPERATOR SUPRAINCARCAT
Supraincarcarea operatorului de indexare















 
Copyright © 2019 - Toate drepturile rezervate