06.09.2013 Views

Digitale electronica en processoren Digitale electronica en ...

Digitale electronica en processoren Digitale electronica en ...

Digitale electronica en processoren Digitale electronica en ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5) Andere Andere codes: codes: BCD, BCD, ASCII, ASCII, ECC, ECC, ECC, …<br />

…<br />

BCD code : Binairy Coded Decimal : Code voor decimale getall<strong>en</strong> voor te stell<strong>en</strong><br />

We k<strong>en</strong>n<strong>en</strong> aan elk cijfer tuss<strong>en</strong> 1 <strong>en</strong> 9 e<strong>en</strong> 4bit binaire code toe die overe<strong>en</strong>stemt met het cijfer :<br />

0=0000, 1=0001, … 9=1001. De andere binaire getall<strong>en</strong> 1010 tot 1111 word<strong>en</strong> niet gebruikt.<br />

- negatieve getall<strong>en</strong> word<strong>en</strong> voorgesteld met hun 10-complem<strong>en</strong>t (zowiezo extra bit nodig)<br />

- optell<strong>en</strong> optell<strong>en</strong> gebeurt zoals altijd, alle<strong>en</strong> moet<strong>en</strong> we oppass<strong>en</strong> met overdracht omdat niet elk binair<br />

cijfer gebruikt is : voor getall<strong>en</strong> tuss<strong>en</strong> 10 <strong>en</strong> 19 moet<strong>en</strong> we de overdracht corriger<strong>en</strong> met 10<br />

ASCII ASCII : : American American Standard Standard Code Code for for Information Information Interchange Interchange : Karaktercode die elke alfabetletter<br />

<strong>en</strong> e<strong>en</strong> hoop toets<strong>en</strong>bord-tek<strong>en</strong>s codeert met 7 bits. Kan makkelijk opgeslag<strong>en</strong> word<strong>en</strong> in 1 byte (8<br />

bits) waarbij de 8ste bit e<strong>en</strong> foutcorrectiebit is.<br />

Booleaanse Booleaanse algebra<br />

algebra<br />

1) 1) Axiomat Axiomatische Axiomat ische definitie van booleaanse algebra algebra<br />

Booleaanse algebra is e<strong>en</strong> set van elem<strong>en</strong>t<strong>en</strong> B {0,1}, e<strong>en</strong> set van operator<strong>en</strong> [+, •, ’ ] <strong>en</strong> axiomas :<br />

Axioma 1 : B is geslot<strong>en</strong> geslot<strong>en</strong> geslot<strong>en</strong> voor + <strong>en</strong> •<br />

het resultaat van optelling of product is opnieuw elem<strong>en</strong>te van B :<br />

x + y ∈ B <strong>en</strong> x • y (= xy) ∈ B<br />

Axioma 2 : B heeft e<strong>en</strong> e<strong>en</strong>heidselem<strong>en</strong>t 0 voor + <strong>en</strong> e<strong>en</strong> e<strong>en</strong>heidselem<strong>en</strong>t 1 voor •<br />

resultaat van bewerking van getal <strong>en</strong> e<strong>en</strong>heidselem<strong>en</strong>t is terug dat getal :<br />

x + 0 = x <strong>en</strong> x • 1 = x<br />

Axioma 3 : B is commutatief commutatief voor + <strong>en</strong> •<br />

plaats van elem<strong>en</strong>t<strong>en</strong> in de bewerking is niet belangrijk :<br />

x + y = y + x <strong>en</strong> x • y = y • x<br />

Axioma 4 : B is distrib distributiviteit<br />

distrib utiviteit voor + <strong>en</strong> •<br />

volgorde der bewerking<strong>en</strong> is niet belangrijk : haakjes uitwerk<strong>en</strong> :<br />

x • (y + z) = (x • y) + (x • z) <strong>en</strong> x + (y • z) = (x + y) • (x + z)<br />

Axioma 5 : B heeft voor + <strong>en</strong> • voor elk getal e<strong>en</strong> complem<strong>en</strong>ta<br />

complem<strong>en</strong>tair complem<strong>en</strong>ta<br />

complem<strong>en</strong>tair<br />

ir elem<strong>en</strong>t<br />

elk elem<strong>en</strong>t heeft e<strong>en</strong> teg<strong>en</strong>gestelde : elke bewerking van e<strong>en</strong> elem<strong>en</strong>t met zijn<br />

teg<strong>en</strong>gestelde geeft het e<strong>en</strong>heidselem<strong>en</strong>t voor die bewerking :<br />

∀ x ∈ B, ∃ x’ ∈ B : x + x’ = 1 <strong>en</strong> x • x’ = 0 (0+1=1 <strong>en</strong> 0•1=0)<br />

Axioma 6 : B heeft minst<strong>en</strong>s minst<strong>en</strong>s 2 2 elem<strong>en</strong>t<strong>en</strong> (cardinality bound)<br />

Verschill<strong>en</strong> Verschill<strong>en</strong> met de gewone algebra : :<br />

In booleaanse algebra bestaat ge<strong>en</strong> inverse bewerking voor de optelling (OR) of de<br />

verm<strong>en</strong>igvuldiging (AND) : aftrekking aftrekking of of deling deling bestaan bestaan niet niet (invers elem<strong>en</strong>t wel)<br />

In gewone algebra is + niet distributief distributief t.o.v. t.o.v. × × : 5 + (2 × 4) ≠ (5 + 2) × (5 + 4)<br />

1 + (1 • 0) = (1+1) • (1+0)<br />

In gewone algebra geldt niet niet dat x + x’ = 1 <strong>en</strong> <strong>en</strong> x x × × x’ x’ = = 0<br />

We definiër<strong>en</strong> nu + + als OR OR, OR<br />

• als AND AND <strong>en</strong> ‘ als inv inverse inv<br />

erse :

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!