Вы находитесь на странице: 1из 4

Gua de ejercicios 1) Se pide realizar una funcin en visual basic, tal funcin deber entregar como resultado dicha

operacin: Resultado= [(Dato1.Dato2)+3].5 2) Se pide una funcin lgica aplicando mascaras. El byte de datos que reciba, deber ser setear los 2 primeros bits y los 2 ms significativos. 3) Realice un programa que muestre en un label la siguiente secuencia cclica cada 2 segundos. Secuencia=5-8-9-10 4) Realizar la siguiente funcin combinacional en visual basic, utilizando los Checkbox. Z=(A.B.C)+(C.D) 5) Basndose en las funciones ya hechas bsf y bcf de 8bits. Amplelas a 2 bytes. Se pide usar los textbox y dems controles necesarios para la prueba de funcionamiento. 6) Si multiplicamos un registr por 2, todo el registro es desplazado un lugar hacia la izquierda. Utilice dicha exposicin para crear la funcin swap de los pic micros. 7) Desarrolle la funcin btf. La funcin recibe 2 bytes para dato y bit. Debe retornar el estado del bit seleccionado. 8) Dada la tabla de verdad de un Latch RS. Se pide obtener la funcin aplicando el mapa de Karnaught e implementar con los checkbox la funcin. Se pide observar funcionamiento. 9) Dada la tabla. Aplicamos Karnaught y obtuvimos las siguientes funciones cannicas: P0=A P1=D.B+D.C.B P2=D.C+C.B
Pgina 1

P3=D.C.B P4=D.C+D.B P5=P6=P7=0


D 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 C 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 P7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 P6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 P5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 P4 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 P3 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 P2 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 P1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 P0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Con todo esto construya el siguiente formulario y trascriba el cdigo dado. Luego explique funcionamiento. Para convertir 1 byte en BCD, que debera hacer?

Public P0 As Byte Public P1 As Byte Public P2 As Byte


Pgina 2

Public P3 As Byte Public P4 As Byte Public RESULTADO As Byte Private Sub Command1_Click() P4 = (d.Value And c.Value) Or (d.Value And b.Value) P3 = d.Value And Not c.Value And Not b.Value P2 = (Not d.Value And c.Value) Or (c.Value And b.Value) P1 = (Not d.Value And b.Value) Or (d.Value And c.Value And Not b.Value) P0 = a.Value RESULTADO = (P3 * 2 ^ 3) + (P2 * 2 ^ 2) + (P1 * 2 ^ 1) + (P0 * 2 ^ 0) Text2.Text = RESULTADO Text3.Text = P4 * 2 ^ 0 End Sub Private Sub Form_Load() End Sub 10) Dado el cdigo se pide: A) Levantar el algoritmo: B) En un nuevo formulario poner todos los controles necesarios para que funcione el cdigo. C) Explicar funcionamiento. Hasta qu numero decodifica? D) Construya la funcin CONVDECBCD. Con el cdigo dado. Cdigo UNIDADES = Text1.Text CENTENAS = 0
Pgina 3

A: DECENAS = 0 B: UNIDADES = UNIDADES - 10 If UNIDADES < 10 Then DECENAS = DECENAS + 1 GoTo FIN Else: DECENAS = DECENAS + 1 If DECENAS = 10 Then CENTENAS = CENTENAS + 1 GoTo A Else: GoTo B End If End If FIN: Text2.Text = UNIDADES Text3.Text = DECENAS Text4.Text = CENTENAS

Pgina 4

Вам также может понравиться