Está en la página 1de 11

UNIVERSIDAD AUTÓNOMA “TOMÁS FRÍAS”

FACULTAD DE INGENIERÍA TECNOLÓGICA

ELECTRÓNICA DIGITAL II Y LABORATORIO ETN 601

LABORATORIO # 5
PRE INFORME

ESTUDIANTES: Andrea Micaela Quispe Patiño Ingeniería Electrónica

Jhonny W. Peñaloza Cabello Ingeniería Mecatrónica

Moisés Torrez Inclan Ingeniería Electrónica

DOCENTE: M.Sc.Ing. Ramiro Russo Negrón

FECHA DE PRESENTACIÓN: 27 de noviembre de 2018


1. Diseñar un circuito en verilog donde se haga mover el motor paso a
paso, si se presiona X0 gira en sentido antihorario, si se presiona X1 gira
en sentido horario y si se presiona X2 el motor se para.

PROCEDIMIENTO DE DISEÑO.-

Sentido de giro del motor:

SENTIDO HORARIO SENTIDO ANTIHORARIO

1 0 1 0 0 1 1 0

1 0 0 1 0 1 0 1

0 1 0 1 1 0 0 1

0 1 1 0 1 0 1 0

1) 2 entradas con Pul2 sentido horario

2) 4 salidas con Pul1 sentido antihorario

TABLA DE VERDAD

Pul1 Pul2 At-1 Bt-1 Ct-1 Dt-1 At Bt Ct Dt

0 0 0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 1 0 0 0 0

2 0 0 0 0 1 0 0 0 0 0

3 0 0 0 0 1 1 0 0 0 0

4 0 0 0 1 0 0 0 0 0 0

5 0 0 0 1 0 1 0 0 0 0

6 0 0 0 1 1 0 0 0 0 0

7 0 0 0 1 1 1 0 0 0 0

8 0 0 1 0 0 0 0 0 0 0

9 0 0 1 0 0 1 0 0 0 0

10 0 0 1 0 1 0 0 0 0 0

11 0 0 1 0 1 1 0 0 0 0

12 0 0 1 1 0 0 0 0 0 0

13 0 0 1 1 0 1 0 0 0 0
14 0 0 1 1 1 0 0 0 0 0

15 0 0 1 1 1 1 0 0 0 0

16 0 1 0 0 0 0 1 0 1 0

17 0 1 0 0 0 1 x x x x

18 0 1 0 0 1 0 x x x x

19 0 1 0 0 1 1 x x x x

20 0 1 0 1 0 0 x x x x

21 0 1 0 1 0 1 0 1 1 0

22 0 1 0 1 1 0 1 0 1 0

23 0 1 0 1 1 1 x x x x

24 0 1 1 0 0 0 x x x x

25 0 1 1 0 0 1 0 1 0 1

26 0 1 1 0 1 0 1 0 0 1

27 0 1 1 0 1 1 x x x x

28 0 1 1 1 0 0 x x x x

29 0 1 1 1 0 1 x x x x

30 0 1 1 1 1 0 x x x x

31 0 1 1 1 1 1 x x x x

32 1 0 0 0 0 0 0 1 1 0

33 1 0 0 0 0 1 x x x x

34 1 0 0 0 1 0 x x x x

35 1 0 0 0 1 1 x x x x

36 1 0 0 1 0 0 x x x x

37 1 0 0 1 0 1 1 0 0 1

38 1 0 0 1 1 0 0 1 0 1

39 1 0 0 1 1 1 x x x x

40 1 0 1 0 0 0 x x x x
41 1 0 1 0 0 1 1 0 1 0

42 1 0 1 0 1 0 0 1 1 0

43 1 0 1 0 1 1 x x x x

44 1 0 1 1 0 0 x x x x

45 1 0 1 1 0 1 x x x x

46 1 0 1 1 1 0 x x x x

47 1 0 1 1 1 1 x x x x

48 1 1 0 0 0 0 0 0 0 0

49 1 1 0 0 0 1 0 0 0 0

50 1 1 0 0 1 0 0 0 0 0

51 1 1 0 0 1 1 0 0 0 0

52 1 1 0 1 0 0 0 0 0 0

53 1 1 0 1 0 1 0 0 0 0

54 1 1 0 1 1 0 0 0 0 0

55 1 1 0 1 1 1 0 0 0 0

56 1 1 1 0 0 0 0 0 0 0

57 1 1 1 0 0 1 0 0 0 0

58 1 1 1 0 1 0 0 0 0 0

59 1 1 1 0 1 1 0 0 0 0

60 1 1 1 1 0 0 0 0 0 0

61 1 1 1 1 0 1 0 0 0 0

62 1 1 1 1 1 0 0 0 0 0

63 1 1 1 1 1 1 0 0 0 0

Dado que se tiene una tabla con 6 variables, para la obtención de las funciones
simplificadas se hizo uso de un resolvedor de mapas de Karnaugh online:
www.32x8.com

Las funciones obtenidas son:

At = ~pul1&pul2&~Dt-1 | pul1&~pul2~Dt-1
Bt = ~pul1&pul2&Dt-1 | pul1&~pul2&~Dt-1

Ct = ~pul1&pul2&~At-1 | pul1&~pul2&~Bt-1

Dt =.~pul1&pul2&At-1 | pul1&~pul2&Bt-1

CIRCUITO IMPLEMENTADO.-

Circuito en multisim

Código en Verilog
module FFD(ck, rst, D, Q);
input ck, rst, D;
output Q;

reg Q;

initial Q = 0;

always @(negedge ck or posedge rst)


begin
if(rst == 1)
Q = 0;
else
Q = D;
end
endmodule

module motorPaP(ck,rst,pul1t1,pul2t2,A,B,C,D);
input ck,rst,pul1t1,pul2t2;
output A,B,C,D;

wire At1,Bt1,Ct1,Dt1,x,pul1,pul2,rst1,rst2;
assign x = 1;
assign rst1 = pul2t2 | rst;
assign rst2 = pul1t1 | rst;

assign At1 = ~pul1&pul2&~D | pul1&~pul2&D;


assign Bt1 = ~pul1&pul2&D | pul1&~pul2&~D;
assign Ct1 = ~pul1&pul2&~A | pul1&~pul2&~B;
assign Dt1 = ~pul1&pul2&A | pul1&~pul2&B;

FFD D0(pul1t1,rst1,x, pul1);


FFD D1(pul2t2,rst2,x, pul2);

FFD D2(ck,rst,At1,A);
FFD D3(ck,rst,Bt1,B);
FFD D4(ck,rst,Ct1,C);
FFD D5(ck,rst,Dt1,D);

endmodule

TABLA DE ASIGNACIÒN DE PINES.-


2. Diseñar un circuito en Verilog que utilice el sensor infrarrojo de manera
que cuente cuantas veces se interrumpe la señal, cuando se interrumpe 5
veces por el parlante sale una alarma y el sonido continua hasta que se
resetea con el pulsador X0

PROCEDIMIENTO DE DISEÑO.-

1) 0 entradas
2) 4 salidas

Buzt-1 Z2t-1 Z1t-1 Z0t-1 buz Z2 Z1 Z0


0 0 0 0 0 0 0 0 1
1 0 0 0 1 0 0 1 0
2 0 0 1 0 0 0 1 1
3 0 0 1 1 0 1 0 0
4 0 1 0 0 1 1 0 1
5 0 1 0 1 X X X X
6 0 1 1 0 X X X X
7 0 1 1 1 X X X X
8 1 0 0 0 X X X X
9 1 0 0 1 X X X X
10 1 0 1 0 X X X X
11 1 0 1 1 X X X X
12 1 1 0 0 X X X X
13 1 1 0 1 1 1 0 1
14 1 1 1 0 X X X X
15 1 1 1 1 x x x x
Para Buzt: Para Z2:

Z1t-1 00 01 11 10 Z1t-1 00 01 11 10
z0t-1 Z0t-1
Buzt-1 Buzt-1
z2t-1 Z2t-1
00 0 0 0 0 00 0 0 1 0
01 1 X x x 01 1 x x X
11 X 1 x x 11 X x x X
10 x x x X 10 x x X x

Buzt = Z2t-1
Z2 =Z2t-1 | Z1t-1&Z0t-1

Para Z1: Para Z0:

Z1t-1 00 01 11 10 Z1t-1 00 01 11 10
z0t-1 Z0t-1
Buzt-1 Buzt-1
z2t-1 Z2t-1
00 0 1 0 1 00 1 0 0 1
01 0 0 x x 01 1 X x X
11 X 0 x x 11 X 1 x X
X1
10 x x x X 10 x x X x
2.5 V

U7
Z1 = ~Z1t-1&~Z1t-1&Z0t-1 | Z1t-1~&Zot-1
Z0 = ~Z0t-1 | Z2t-1
X2 OR2

U5
2.5 V
U11
AND2
U6
X3 OR2

2.5 V AND3
U9

CIRCUITO IMPLEMENTADO.-
U8
X4 OR2

Circuito
2.5 V en multisim AND2

U1 U2 U3 U4
SET SET SET SET
VCC
D Q D Q D Q D Q
5V
J1 CLK ~Q CLK ~Q CLK ~Q CLK ~Q
RESET RESET RESET RESET

D_FF D_FF D_FF D_FF


Key =A

VCC
5V
J2
Key =B
Código en Verilog

module DD(ck, rst, D, Q);


input ck, rst, D;
output Q;

reg Q;

initial Q = 0;

always @(negedge ck or posedge rst)


begin
if(rst == 1)
Q = 0;
else
Q = D;
end
endmodule

module do (clk,clk_out_do);
input clk;
output clk_out_do;

reg clk_out_do;

parameter frecuencia=40000000;
parameter freq_out=261;
parameter max_count=frecuencia/(2*freq_out);

reg[22:0] count;

initial begin
count=0;
clk_out_do=0;
end

always @(posedge clk) begin

if(count==(max_count))
begin
clk_out_do=~clk_out_do;
count=0;
end
else
begin
count=count+1;
end

end

endmodule

module infrarrojo (ck,clk,rst,BUZ,buzzer, Z2,Z1,Z0,transmisor);


input ck,rst,clk;
output BUZ,Z2,Z1,Z0,transmisor,buzzer;

wire BUZt1, Z2t1, Z1t1,Z0t1, do;

assign transmisor = 1;
assign buzzer = BUZ&do;
assign BUZt1 = Z2;
assign Z2t1 = Z2 | (Z1&Z0);
assign Z1t1 = (~BUZ&~Z1&Z0)|(Z1&~Z0);
assign Z0t1 = Z2 | ~Z0;

DD D0(ck,rst,BUZt1, BUZ);
DD D1(ck,rst,Z2t1, Z2);
DD D2(ck,rst,Z1t1,Z1);
DD D3(ck,rst,Z0t1,Z0);
do DF4(clk,clk_out_do);

endmodule

TABLA DE ASIGNACIÒN DE PINES.-

También podría gustarte