lab 3 microelec
TRANSCRIPT
-
7/21/2019 Lab 3 Microelec
1/6
EJEMPLO 3.3: SUMADOR
En la fgura 3.3 se muestra el diagrama de un sumador de 4 bits. El circuito
tiene dos entradas (a, b) y una salida (sum). e !resentan dos soluciones.
En la !rimera, todas las entradas son de ti!o SIGNED, mientras "ue en la
segunda todas las salidas son de ti!o INTEGER. #ota "ue en la soluci$n %"ue se us$ una con&ersi$n de 'unci$n en la lnea 3, !ara una ti!o de a * b
de la suma. #otar tambi+n "ue la inclusi$n del !a"uete std_logic_arith
(lnea 4 de cada solucin), el cual se es!ecifca el ti!o de dato SIGNED.
ol&er a llamar un &alor SIGNED es re!resentado como un &ector, esto es,
similar a STD_LOGIC_VECTOR, no como un INTEGER.
Figura 3.3A Circuito para e e!e"po 3.3
SOLUCION DEL E#EM$LO 3.3.
$RIMERA SOLUCION%
-$digo usado en el E %.
------------------------------------------------------------------------------------ Company: UNSA 2014-- Engineer: EPIE 2014B---- Create Date: 09:47:3 10!0"!2014-- De#ign Name:-- $o%&'e Name: SU$AD() - Be*a+iora'-- Pro,et Name:-- .arget De+ie#: SPA).AN 3E-- .oo' +er#ion#:-- De#ription:
---- Depen%enie#:---- )e+i#ion:-- )e+i#ion 0/01 - i'e Create%-- IN.E)AN.ES:-- ANUEC5A A)UE6 DENNS $A).IN-- 8EA 8EA)DE6 8IC.() UIE------------------------------------------------------------------------'irary IEEE;e IEEE/S.D
-
7/21/2019 Lab 3 Microelec
2/6
-- Arit*meti =&ntion# >it* Signe% or Un#igne% +a'&e#--e IEEE/NU$E)ICing 'irary %e'aration i= in#tantiating-- Any ?i'in@ primiti+e# in t*i# o%e/--'irary UNISI$;
--e UNISI$/8Component#/a'';entity SU$AD()i# Port a : in SINED 3 D(N.( 0; : in SINED 3 D(N.( 0; #&m : o&t SINED 4 D(N.( 0;en%SU$AD();ar*itet&re Be*a+iora'o=SU$AD()i#egin
#&m a F ;en%Be*a+iora';
CODIGO DEL TESTBENCH:
------------------------------------------------------------------------ Company: UNSA-- Engineer: EPIE-UNSA 2014B---- Create Date: 09:49:32 10!0"!2014-- De#ign Name:-- $o%&'e Name: E:!$ay# e e% =or t*e top-'e+e' I!( o= a %e#ignin or%er-- to g&arantee t*at t*e te#ten* >i'' in% orret'y to t*e po#t-imp'ementation-- #im&'ation mo%e'/---------------------------------------------------------------------IB)A) ieee;USE ieee/#t%
-
7/21/2019 Lab 3 Microelec
3/6
EN.I. SU$AD()ait =or0n#; J1111J;>ait =or10n#;-- J0100J a=ter 0 n#6 J1100J a=ter 00 n#6 J1011J a=ter 400 n#;END P)(CESS; -- Stim&' proe## END;
-
7/21/2019 Lab 3 Microelec
4/6
SIMULACION:
SEGUNDA SOLUCION:
Figura 3.3& Circuito para e e!e"po 3.3", 'u"a(or (e ) *it'
CODIGO USADO EN LA SOLUCION:
------------------------------------------------------------------------ Company: UNSA-- Engineer: EPIE-UNSA 2014B---- Create Date: 09:31:12 10!0"!2014-- De#ign Name:-- $o%&'e Name: SU$AD() - Be*a+iora'-- Pro,et Name:-- .arget De+ie#:
-- .oo' +er#ion#:-- De#ription:---- Depen%enie#:---- )e+i#ion:-- )e+i#ion 0/01 - i'e Create%-- IN.E)AN.ES:
ANUEC5A A)UE6 DENNS $A).IN 8EA 8EA)DE6 8IC.() UIE
----------------------------------------------------------------------'irary IEEE;e IEEE/S.D
-
7/21/2019 Lab 3 Microelec
5/6
-- Unomment t*e =o''o>ing 'irary %e'aration i= in#tantiating-- any ?i'in@ primiti+e# in t*i# o%e/--'irary UNISI$;--e UNISI$/8Component#/a'';
entity SU$AD()i#
Port a : in SINED 3 D(N.( 0; : in SINED 3 D(N.( 0; #&m : o&t IN.EE) )ANE-1".(1;en%SU$AD();
ar*itet&re Be*a+iora'o=SU$AD()i#egin #&m C(N8
-
7/21/2019 Lab 3 Microelec
6/6
SIMULACION: