Documente Academic
Documente Profesional
Documente Cultură
Anul: III
Grupa: 2
Subgrupa: 2
Detalii proiect:
Se da urmatorul set de instructiuni: A (AL3,AI5,AL7,AL10,M1,M2,J2,J3,J5)
Aceste instructiuni se aplica asupra unor registrii de uz general, reprezentati generic cu Rd si Rs.
La realizarea programelor, d si s se inlocuiesc cu numere incepand cu valorea 0, deci vom avea
R0,R1,etc.
Instructiunile vor avea ca operanzi registrii (deci vor opera asupra continutului lor), constant
(reprezentate cu ct – reprezinta valori numerice date din memoria de date sau adrese de memorie date.
Se cere:
Se dau D (19) numere care se afla depuse in memoria de date, incepand cu o adresa aleasa de
proiectant. Sa se efectueze o operatie E (AL3) intre toti termenii iar rezultatul(sau rezultatele) sa se
depuna in memoria de date la o adresa de asemenea stabilita de proiectant dar care nu se
suprapune cu cea in care se afla termenii initiali.
-AL3 => AND Rd, Rs1, Rs2 => In registrul Rd se plaseaza rezultatul SI logic dintre
continutul registrului Rs1 si Rs2
Cod VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity AL3 is
port(
);
end AL3;
begin
c<=a AND b;
end AL3a;
-AI5 => XRI Rd, Rs, Ct => In registrul Rd se plaseaza rezultatul SAU exclusiv
logic dintre continutul registrului Rs1 si ct
Cod VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity AI5 is
port(
end AI5;
begin
end AI5a;
AL7 => MUL Rd1,Rd2,Rs1,Rs2 => In registrul Rd1 se plaseaza partea High si in
registrul Rd2 se plaseaza partea Low din produsul dintre continutul registrului
Rs1 si Rs2
-AL10 => SR Rd,Rs => In registrul Rd se plaseaza rezultatul deplasarii cu o poz la
dreapta a continutului registrului Rs, bitul High este 0\
Cod VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity AL10 is
port(
);
end AL10;
begin
end AL10a;
Circuit zero:
library IEEE;
use IEEE.STD_logic_1164.all;
entity circuit_zero is
port(
);
end circuit_zero;
begin
rez<= i(0) or i(1) or i(2) or i(3) or i(4) or i(5) or i(6) or i(7) or i(8) or i(9) or i(10)
end circuit_zero_a;
Dmux 1:16 :
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity dmux1_16 is
port(
E : in STD_LOGIC;
y0 : out STD_LOGIC;
y1 : out STD_LOGIC;
y2 : out STD_LOGIC;
y3 : out STD_LOGIC;
y4 : out STD_LOGIC;
y5 : out STD_LOGIC;
y6 : out STD_LOGIC;
y7 : out STD_LOGIC;
y8 : out STD_LOGIC;
y9 : out STD_LOGIC;
);
end dmux1_16;
begin
process(s)
begin
if(s="0000")then
y0<=E;
elsif(s="0001")then
y1<=E;
elsif(s="0010")then
y2<=E;
elsif(s="0011")then
y3<=E;
elsif(s="0100")then
y4<=E;
elsif(s="0101")then
y5<=E;
elsif(s="0110")then
y6<=E;
elsif(s="0111")then
y7<=E;
elsif(s="1000")then
y8<=E;
elsif(s="1001")then
y9<=E;
elsif(s="1010")then
y10<=E;
elsif(s="1011")then
y11<=E;
elsif(s="1100")then
y12<=E;
elsif(s="1101")then
y13<=E;
elsif(s="1110")then
y14<=E;
elsif(s="1111")then
y15<=E;
end if;
end process;
end dmux_16a;
Mux 4:1 :
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity mux4_1 is
port(
I0 : in STD_LOGIC;
I1 : in STD_LOGIC;
I2 : in STD_LOGIC;
I3 : in STD_LOGIC;
S0 : in STD_LOGIC;
S1 : in STD_LOGIC;
Z : out STD_LOGIC
);
end mux4_1;
begin
process (I0,I1,I2,I3,S0,S1) is
begin
if (S0 ='0' and S1 = '0') then
Z <= I0;
Z <= I1;
Z <= I2;
else
Z <= I3;
end if;
end process;
end mux4_1_a;
Mux 19:1 :
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity mux19_1 is
port(
);
end mux19_1;
process(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,s)
begin
if(s="00000")then
y<=x0;
elsif(s="00001")then
y<=x1;
elsif(s="00010")then
y<=x2;
elsif(s="00011")then
y<=x3;
elsif(s="00100")then
y<=x4;
elsif(s="00101")then
y<=x5;
elsif(s="00110")then
y<=x6;
elsif(s="00111")then
y<=x7;
elsif(s="01000")then
y<=x8;
elsif(s="01001")then
y<=x9;
elsif(s="01010")then
y<=x10;
elsif(s="01011")then
y<=x11;
elsif(s="01100")then
y<=x12;
elsif(s="01101")then
y<=x13;
elsif(s="01110")then
y<=x14;
elsif(s="01111")then
y<=x15;
elsif(s="10000")then
y<=x16;
elsif(s="10001")then
y<=x17;
elsif(s="10010")then
y<=x18;
else
y<="ZZZZZZZZZZZZZZZZZZZ";
end if;
end process;
end mux_19_1a;
RPP:
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity rpp is
port(
clk: in std_logic;
);
end rpp;
begin
process(clk,di)
begin
q<=di;
end if;
end process;
end rpp_a;
Sumator 19 biti:
library IEEE;
use IEEE.std_logic_1164.all;
entity sumator19bit is
port(
);
end sumator19bit;
component sumator1bit
port (
a : in STD_LOGIC;
b : in STD_LOGIC;
ci : in STD_LOGIC;
co : out STD_LOGIC;
s : out STD_LOGIC
);
end component;
signal co1,co2,co3,co4,co5,co6,co7,co8,co9,co10,co11,co12,co13,co14,co15,co16,co17,co18 :
STD_LOGIC;
begin
U1 : sumator1bit
port map(
a => a19(0),
b => b19(0),
ci => GND,
co => co1,
s => s19(0)
);
U2 : sumator1bit
port map(
a => a19(1),
b => b19(1),
ci => co1,
co => co2,
s => s19(1)
);
U3 : sumator1bit
port map(
a => a19(2),
b => b19(2),
ci => co2,
co => co3,
s => s19(2)
);
U4 : sumator1bit
port map(
a => a19(3),
b => b19(3),
ci => co3,
co => co4,
s => s19(3)
);
U5 : sumator1bit
port map(
a => a19(4),
b => b19(4),
ci => co4,
co => co5,
s => s19(4)
);
U6 : sumator1bit
port map(
a => a19(5),
b => b19(5),
ci => co5,
co => co6,
s => s19(5)
);
U7 : sumator1bit
port map(
a => a19(6),
b => b19(6),
ci => co6,
co => co7,
s => s19(6)
);
U8 : sumator1bit
port map(
a => a19(7),
b => b19(7),
ci => co7,
co => co8,
s => s19(7)
);
U9 : sumator1bit
port map(
a => a19(8),
b => b19(8),
ci => co8,
co => co9,
s => s19(8)
);
U10 : sumator1bit
port map(
a => a19(9),
b => b19(9),
ci => co9,
co => co10,
s => s19(9)
);
U11 : sumator1bit
port map(
a => a19(10),
b => b19(10),
ci => co10,
co => co11,
s => s19(10)
);
U12 : sumator1bit
port map(
a => a19(11),
b => b19(11),
ci => co11,
co => co12,
s => s19(11)
);
U13 : sumator1bit
port map(
a => a19(12),
b => b19(12),
ci => co12,
co => co13,
s => s19(12)
);
U14 : sumator1bit
port map(
a => a19(13),
b => b19(13),
ci => co13,
co => co14,
s => s19(13)
);
U15 : sumator1bit
port map(
a => a19(14),
b => b19(14),
ci => co14,
co => co15,
s => s19(14)
);
U16 : sumator1bit
port map(
a => a19(15),
b => b19(15),
ci => co15,
co => co16,
s => s19(15)
);
U17 : sumator1bit
port map(
a => a19(16),
b => b19(16),
ci => co16,
co => co17,
s => s19(16)
);
U18 : sumator1bit
port map(
a => a19(17),
b => b19(17),
ci => co17,
co => co18,
s => s19(17)
);
U19 : sumator1bit
port map(
a => a19(18),
b => b19(18),
ci => co18,
co => co_fin,
s => s19(18)
);
end sumator19bit_a;
Sumator 1 bit:
library ieee;
use ieee.std_logic_1164.all;
entity sumator1bit is
port(
a: in std_logic;
b: in std_logic;
ci: in std_logic;
s: out std_logic
);
end sumator1bit;
begin
s1 <= a xor b;
t1 <= a and b;
s <= s1 xor ci;
co <= t1 or t2;
end sumator1bit_a;
Schema UAL:
Rps19biti:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.std_logic_unsigned.all;
entity rps19biti is
port(
si : in STD_LOGIC;
s_notp : in STD_LOGIC;
clk : in STD_LOGIC;
);
end rps19biti;
begin
process(clk,pi,si,s_notp)
begin
q_int := pi;
else
q_int(18) := si;
end if;
end if;
q <= q_int;
end process;
end rps19biti_a;
Schema registri:
Interfata: