background image

 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sprawozdanie z ćwiczenia numer 3 

 

Data wykonania ćwiczenia: 2008-10-16

 

 

Temat ćwiczenia: 

Projektowanie systemów cyfrowych w 

oparciu o układy programowalne 

 

 
 

 

  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Laboratorium Układów Mikroprocesorowych 

Rok akademicki 

Termin 

Rodzaj studiów 

Kierunek 

Prowadzący 

Grupa 

Sekcja 

2008/2009  Wtorek 

18:15-19:45 

wieczorowe 

INF 

BS 

2  1 

Skład podsekcji: 

Rafał Pacan 
Paweł Sadowski 
Grzegorz Kwiatkowski 
Robert Uszok 
Wojciech Szymoszek 
Ireneusz Zydroń 
 
 
 
 
 
 
 
 

background image

1. TEMAT ĆWICZENIA 
 

Tematem ćwiczenia było zaprojektowanie i napisanie programu dla 

urządzenie  wyświetlającego    na  wyświetlaczu  7-segmentowym  liczby  w 
zapisie szesnastkowym, posiadające wejście testujące oraz wygaszające. 

 
 
2.  ROZWIĄZANIE PROBLEMU 
 

Kod programu w języku Abel: 

 

module c3z1 
 
a,b,c,d,e,f,g pin istype 'com'; "wyjscia 
w,t,a3,a2,a1,a0 pin; "wejscia 
 
S = [w,t];             "w - wygaszenie 
                       "t - test 
A = [a3,a2,a1,a0];     "a3..a0 - cyfra szesnastkowa do 
                       "wysw podana binarnie 
W = [a,b,c,d,e,f,g]; "a..h - segmenty wy

ś

wietlacza 7-segm 

 
equations                      
truth_table  ([A,S] -> [a,b,c,d,e,f,g]) 
              [0,0] -> [1,1,1,1,1,1,0]; 
              [1,0] -> [0,1,1,0,0,0,0]; 
              [2,0] -> [1,1,0,1,1,0,1]; 
              [3,0] -> [1,1,1,1,0,0,1]; 
              [4,0] -> [0,1,1,0,0,1,1]; 
              [5,0] -> [1,0,1,1,0,1,1]; 
              [6,0] -> [1,0,1,1,1,1,1]; 
              [7,0] -> [1,1,1,0,0,0,0]; 
              [8,0] -> [1,1,1,1,1,1,1]; 
              [9,0] -> [1,1,1,1,0,1,1]; 
              [10,0] -> [1,1,1,0,1,1,1]; 
              [11,0] -> [0,0,1,1,1,1,1]; 
              [12,0] -> [1,0,0,1,1,1,0]; 
              [13,0] -> [0,1,1,1,1,0,1]; 
              [14,0] -> [1,0,0,1,1,1,1]; 
              [15,0] -> [1,0,0,0,1,1,1]; 
              [.x.,1] -> [1,1,1,1,1,1,1]; 
              [.x.,2] -> [0,0,0,0,0,0,0]; 
              [.x.,3] -> [0,0,0,0,0,0,0];   
 
 
test_vectors ([A,S] -> [a,b,c,d,e,f,g]) 
              [0,0] -> [1,1,1,1,1,1,0]; 
              [1,0] -> [0,1,1,0,0,0,0]; 
              [2,0] -> [1,1,0,1,1,0,1]; 
              [3,0] -> [1,1,1,1,0,0,1]; 
              [4,0] -> [0,1,1,0,0,1,1]; 
              [5,0] -> [1,0,1,1,0,1,1]; 
              [6,0] -> [1,0,1,1,1,1,1]; 
              [7,0] -> [1,1,1,0,0,0,0]; 
              [8,0] -> [1,1,1,1,1,1,1]; 
              [9,0] -> [1,1,1,1,0,1,1]; 
              [10,0] -> [1,1,1,0,1,1,1]; 
              [11,0] -> [0,0,1,1,1,1,1]; 
              [12,0] -> [1,0,0,1,1,1,0]; 
              [13,0] -> [0,1,1,1,1,0,1]; 
              [14,0] -> [1,0,0,1,1,1,1]; 
              [15,0] -> [1,0,0,0,1,1,1]; 

background image

 
@const i=0; 
@repeat 16{ 
[i,1] -> [1,1,1,1,1,1,1]; "aktywne wejscie t 
[i,2] -> [0,0,0,0,0,0,0]; "aktywne wejscie w 
[i,3] -> [0,0,0,0,0,0,0]; "aktywne oba wejscia (w ma 
"wyzszy priorytet 
@const i=i+1;} 
 
End

 

 

3. OPIS 
 

a, b, c, d, e, f, g – wyjścia dekodera, segmenty wyświetlacza 
w, t, a3, a2, a1, a – wejścia 
t - wejście testujące zapalające wszystkie diody na wyświetlaczu 
w - wejście wygaszające wszystkie diody na wyświetlaczu 
a3..a0 - cyfra szesnastkowa do wyświetlenia podana binarnie 

 
 
4. WYNIK DZIAŁANIA KOMPILATORA - SYMULACJA 
 

       a a a a                     
       3 2 1 0 w t   a b c d e f g 
                                   
V0001  0 0 0 0 0 0   H H H H H H L 
V0002  0 0 0 1 0 0   L H H L L L L 
V0003  0 0 1 0 0 0   H H L H H L H 
V0004  0 0 1 1 0 0   H H H H L L H 
V0005  0 1 0 0 0 0   L H H L L H H 
V0006  0 1 0 1 0 0   H L H H L H H 
V0007  0 1 1 0 0 0   H L H H H H H 
V0008  0 1 1 1 0 0   H H H L L L L 
V0009  1 0 0 0 0 0   H H H H H H H 
V0010  1 0 0 1 0 0   H H H H L H H 
V0011  1 0 1 0 0 0   H H H L H H H 
V0012  1 0 1 1 0 0   L L H H H H H 
V0013  1 1 0 0 0 0   H L L H H H L 
V0014  1 1 0 1 0 0   L H H H H L H 
V0015  1 1 1 0 0 0   H L L H H H H 
V0016  1 1 1 1 0 0   H L L L H H H 
V0017  0 0 0 0 0 1   H H H H H H H 
V0018  0 0 0 0 1 0   L L L L L L L 
V0019  0 0 0 0 1 1   L L L L L L L 
V0020  0 0 0 1 0 1   H H H H H H H 
V0021  0 0 0 1 1 0   L L L L L L L 
V0022  0 0 0 1 1 1   L L L L L L L 
V0023  0 0 1 0 0 1   H H H H H H H 
V0024  0 0 1 0 1 0   L L L L L L L 
V0025  0 0 1 0 1 1   L L L L L L L 
V0026  0 0 1 1 0 1   H H H H H H H 
V0027  0 0 1 1 1 0   L L L L L L L 
V0028  0 0 1 1 1 1   L L L L L L L 
V0029  0 1 0 0 0 1   H H H H H H H 
V0030  0 1 0 0 1 0   L L L L L L L 
V0031  0 1 0 0 1 1   L L L L L L L 
V0032  0 1 0 1 0 1   H H H H H H H 
V0033  0 1 0 1 1 0   L L L L L L L 
V0034  0 1 0 1 1 1   L L L L L L L 
V0035  0 1 1 0 0 1   H H H H H H H 
V0036  0 1 1 0 1 0   L L L L L L L 
V0037  0 1 1 0 1 1   L L L L L L L 

background image

V0038  0 1 1 1 0 1   H H H H H H H 
V0039  0 1 1 1 1 0   L L L L L L L 
V0040  0 1 1 1 1 1   L L L L L L L 
V0041  1 0 0 0 0 1   H H H H H H H 
V0042  1 0 0 0 1 0   L L L L L L L 
V0043  1 0 0 0 1 1   L L L L L L L 
V0044  1 0 0 1 0 1   H H H H H H H 
V0045  1 0 0 1 1 0   L L L L L L L 
V0046  1 0 0 1 1 1   L L L L L L L 
V0047  1 0 1 0 0 1   H H H H H H H 
V0048  1 0 1 0 1 0   L L L L L L L 
V0049  1 0 1 0 1 1   L L L L L L L 
V0050  1 0 1 1 0 1   H H H H H H H 
V0051  1 0 1 1 1 0   L L L L L L L 
V0052  1 0 1 1 1 1   L L L L L L L 
V0053  1 1 0 0 0 1   H H H H H H H 
V0054  1 1 0 0 1 0   L L L L L L L 
V0055  1 1 0 0 1 1   L L L L L L L 
V0056  1 1 0 1 0 1   H H H H H H H 
V0057  1 1 0 1 1 0   L L L L L L L 
V0058  1 1 0 1 1 1   L L L L L L L 
V0059  1 1 1 0 0 1   H H H H H H H 
V0060  1 1 1 0 1 0   L L L L L L L 
V0061  1 1 1 0 1 1   L L L L L L L 
V0062  1 1 1 1 0 1   H H H H H H H 
V0063  1 1 1 1 1 0   L L L L L L L 
V0064  1 1 1 1 1 1   L L L L L L L 
 
64 out of 64 vectors passed. 

 

 

5. WNIOSKI 
 

Początkowo  próbowaliśmy  wprowadzić  kaŜde  równanie  z  osobna. 

JednakŜe  okazało  się  to  dość  skomplikowane  i  czasochłonne.  Dlatego 
zastosowaliśmy  tablicę  prawdy.  Przyspieszyło  to  naszą  pracę  a  program 
okazał się o wiele czytelniejszy. Działał jak najbardziej prawidłowo. 
 
 
WERSJA POPRAWIONA – DODANO WYNIKI SYMULACJI