Beruflich Dokumente
Kultur Dokumente
NACIONAL
UNIDAD PROFESIONAL
INTERDISCIPLINARIA EN
INGENIERIA Y TECNOLOGIAS
AVANZADAS
PRACTICA 4
ELECTRONICA EUFORIA
Abstract
In this practice the target is to know the function of the calculators and also that the logic
operations and the priority of the functions; developing the functions of digital control and
automatization, making the calculus processing. This you can find in some devices being the
best example the microprocessor, that help us to make different kinds of operations. Basic
operations as addition, subtraction, or multiplications, we will see in this practice and also
will do the selection between an addition or subtraction by a switch, this one will give us
preferences, at the same time, we can do other operations with priority.
We will also have more complex operations as it can be the division because there are some
mathematical rules that don’t let us divide a number with a zero, for this we will use a zero
for representing any operation that doesn’t have a mathematical definition because the user
can make it an input.
Also, we will develop logic operations as ‘and’ and ‘not’ with two targets, the first one is to
remember what we did in the last practices and the second is to show operations in the 7
segments display to know the operations that is being made.
Abstrakt
In dieser Praxis ist das Ziel, die Funktion der Rechner zu kennen und auch die logischen
Operationen und die Priorität der Funktionen; Entwicklung der Funktionen der digitalen
Steuerung und Automatisierung, um die Kalkülverarbeitung zu ermöglichen. Dies können
Sie in einigen Geräten finden, die das beste Beispiel für den Mikroprozessor sind, die uns
helfen, verschiedene Arten von Operationen zu machen. Grundlegende Operationen wie
Addition, Subtraktion oder Multiplikationen werden wir in dieser Übung sehen und auch die
Auswahl zwischen Addition oder Subtraktion durch einen Schalter treffen, dieser wird uns
Präferenzen geben, gleichzeitig können wir andere Operationen mit Priorität ausführen .
Wir werden auch komplexere Operationen haben, wie es die Division sein kann, da es einige
mathematische Regeln gibt, die uns eine Zahl nicht mit einer Null teilen lassen. Dafür
verwenden wir eine Null, um irgendeine Operation darzustellen, die kein mathematisches hat
Definition, weil der Benutzer es zu einer Eingabe machen kann.
Außerdem werden wir logische Operationen als "und" und "nicht" mit zwei Zielen
entwickeln, das erste ist, sich daran zu erinnern, was wir in den letzten Übungen gemacht
haben, und das zweite ist, Operationen in der 7-Segment-Anzeige anzuzeigen, um die
Operationen zu kennen Gemacht werden.
Introducción
Ejercicio 1
En electrónica un sumador es un circuito lógico que calcula la operación suma. En los
computadores modernos se encuentra en lo que se denomina Unidad aritmeticológica (ALU).
Generalmente realizan las operaciones aritméticas en código binario decimal o BCD exceso
3, por regla general los sumadores emplean el sistema binario. En los casos en los que se esté
empleando un complemento a dos para representar números negativos el sumador se
convertirá en un sumador – sustractor.
Semisumador
Se denomina semisumador al circuito combinacional capaz de realizar la suma aritmética
binaria de dos únicos bits A y B, proporcionando a su salida un bit resultado de suma S y un
bit de acarreo C.
Sumador con acarreo
Este dispositivo nos ofrece una mejora del semisumador al cual se le añade un acarreo de
entrada. De esta manera podemos afrontar sumas de más de un bit para las cuales utilizaremos
el acarreo de salida del anterior en el acarreo de entrada del siguiente. Así completamos la
suma correctamente. A continuación, vemos la tabla de verdad y un esquema.
module SR(a,b,operacion,dis,anodo);
input wire [2:0] a;
input wire [2:0] b;
input wire operacion;
output reg [7:0] dis;
output reg [3:0] anodo;
reg [3:0]resultado;
// Always specify an else statement with a combinatorial if statement in
// order to avoid the inference of a latch
always @(a,b,operacion)
begin
anodo=4'b0111;
case (operacion)
1'b0 : begin
if (a>=b) begin
resultado=a-b;
end
else begin
resultado = 4'b0000;
end
end
1'b1 : begin
resultado=a+b;
end
default: begin
resultado=4'b1111;
end
endcase
end
always @(resultado)
begin
case (resultado)
4'b0000: begin
dis=8'b00000011;///0
end
4'b0001: begin
dis=8'b10011111;///1
end
4'b0010: begin
dis=8'b00100101;///2
end
4'b0011: begin
dis=8'b00001101;///3
end
4'b0100: begin
dis=8'b10011001;///4
end
4'b0101: begin
dis=8'b01001001;///5
end
4'b0110: begin
dis=8'b01000001;///6
end
4'b0111: begin
dis=8'b00011111;///7
end
4'b1000: begin
dis=8'b00000001;///8
end
4'b1001: begin
dis=8'b00011001;///9
end
4'b1010: begin
dis=8'b00010001;///A
end
4'b1011: begin
dis=8'b11000001;///b
end
4'b1100: begin
dis=8'b01100011;///C
end
4'b1101: begin
dis=8'b10000101;///d
end
4'b1110: begin
dis=8'b01100001;///E
end
4'b1111: begin
dis=8'b01110001;///F
end
default: begin
dis=8'b10010001;///||
end
endcase
end
endmodule
UCF
net "a(0)" loc=G18;
Ejercicio 2
module multi(ta0,ta1,ta2,ta3,tb0,tb1,tb2,tb3,x,y,seg,anodo);
always @ (ta0,ta1,ta2,ta3,tb0,tb1,tb2,tb3)
begin
anodo=4'b1101;
x=2'b00; y=2'b00;
if (ta0==1) begin
x=2'b00;
end
else if (ta1==1) begin
x=2'b01;
end
else if (ta2==1) begin
x=2'b10;
end
else if (ta3==1) begin
x=2'b11;
end
else begin
end
if (tb0==1) begin
y=2'b00;
end
else if (tb1==1) begin
y=2'b01;
end
else if (tb2==1) begin
y=2'b10;
end
else if (tb3==1) begin
y=2'b11;
end
else begin
resultado=4'b0000;
end
resultado= x*y;
end
always @(resultado)
begin
case (resultado)
4'b0000: begin
//abcdefgdp
seg=8'b00000011;//0
end
4'b0001: begin
seg=8'b10011111;//1
end
4'b0010: begin
//abcdefgdp
seg=8'b00100101;//2
end
4'b0011: begin
//abcdefgdp
seg=8'b00001101;//3
end
4'b0100: begin
seg=8'b10011001;//4
end
4'b0101: begin
seg=8'b01001001;//5
end
4'b0110: begin
seg=8'b01000001;//6
end
4'b0111: begin
seg=8'b00011101;//7
end
4'b1000: begin
seg=8'b00000001;//8
end
4'b1001: begin
seg=8'b00011001;//9
end
default: begin
seg=8'b11111111;//
end
endcase
end
endmodule
UCF
///Ta
net"ta0" loc=G18;
net"ta1" loc=H18;
net"ta2" loc=K18;
net"ta3" loc=K17;
//Tb
net"tb0" loc=L14;
net"tb1" loc=L13;
net"tb2" loc=N17;
net"tb3" loc=R17;
Ejercicio 4
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
use IEEE.numeric_bit.all;
entity operaciones is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0);
b : in STD_LOGIC_VECTOR (3 downto 0);
operacion : in STD_LOGIC_VECTOR (2 downto 0);
resultado: out STD_LOGIC_VECTOR (3 downto 0);
anodo : out STD_LOGIC_VECTOR (3 downto 0);
seg : out STD_LOGIC_VECTOR (7 downto 0));
end operaciones;
process (a,b,operacion)
begin
anodo<="1110";
resultado<="0000";
case (operacion) is
when "000" =>
-----
"abcdefgdp"
resultado<= not(a); seg<="11011101";--/¬
when "001" =>
resultado<= a and b; seg<="00010001";--/A
when "010" =>
resultado<= a nand b; seg<="00010000";--/A.
when "011" =>
resultado<= a or b; seg<="10010011";--/||
when "100" =>
resultado<= a nor b; seg<="11100001";--/|=
when "101" =>
resultado<= a xor b; seg<="00111011";--/^
when "110" =>
resultado<= a xnor b; seg<="00101001";--/^=
when "111" =>
resultado<= b; seg<="11000001";--/b
when others =>
resultado<= "1111";
end case;
end process;
end Behavioral;
UCF
net"a(0)" loc=G18;
net"a(1)" loc=H18;
net"a(2)" loc=K18;
net"a(3)" loc=K17;
///entrda b
net"b(0)" loc=L14;
net"b(1)" loc=L13;
net"b(2)" loc=N17;
net"b(3)" loc=R17;
///seleccion de operacion
net"operacion(0)" loc=D9;
net"operacion(1)" loc=B8;
net"operacion(2)" loc=C4;
///led's testigos
net"resultado(0)" loc=J14;
net"resultado(1)" loc=J15;
net"resultado(2)" loc=K15;
net"resultado(3)" loc=K14;
Conclusiones
Castillo Meza Víctor Hugo
Se logro comprender las funciones lógicas al igual que las aritméticas, comprendiendo así su
funcionamiento al igual que su uso en los circuitos lógicos.
Se logro armar las practicas al igual que los circuitos y motores
Se logró su funcionamiento correcto y logramos adquirir más experiencia con las compuertas
lógicas al igual que comprender las funciones y con el hardware del FPGA.
Rojas Granada Edgar Leonel
Bibliografía
Bibliografía