babylon - École normale supérieurejv/homepage/cours/digitalwatch.pdf · babylon 1 30 [1 24 51...

12
Sep-02 Digital Systems I – [email protected] 1 Babylon Babylon 1 1 30 30 24 24 51 51 10 10 [1 24 51 10] [1 24 51 10] 60 60 [42 25 35] [42 25 35] 60 60 24 51 10] 24 51 10] 60 60 = 1 = 1 . . 414213… 414213… . . 42 25 35] 42 25 35] 60 60 = 0 = 0 . . 707106… 707106… [0 [0 . . 30] 30] 60 60 = 0 = 0 . . 5 5 [1 [1 . . [0 [0

Upload: others

Post on 24-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 1

BabylonBabylon

11

3030

2424 5151 1010[1 24 51 10][1 24 51 10]6060

[42 25 35][42 25 35]6060

24 51 10]24 51 10]60 60 = 1 = 1 .. 414213…414213…

.. 42 25 35]42 25 35]60 60 = 0 = 0 .. 707106…707106…

[0 [0 .. 30]30]60 60 = 0 = 0 .. 55

[1 [1 ..

[0 [0

Page 2: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 2

Digital WatchDigital Watch

Page 3: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 3

Liquid CrystalLiquid Crystal

Page 4: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 4

Digital Watch: StructureDigital Watch: Structure

fun Montre()=(Six7Segs:net[7][6], day:net)

{

// Divides quartz frequency by 1024

sec = CM1K();

(DCB[0],DCB[1],mn) = CM60(sec);

(DCB[2],DCB[3],hr) = CM60(mn);

(DCB[4],DCB[5],day) = CM24(hr);

// Decode from Binary Coded Decimal

// to 7 segment display

for (k<6)

Six7Segs[k] = Decode7segs(DCB[k]);}

Page 5: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 5

Digital Watch: ComponentsDigital Watch: Components1.1. Counter Modulo 1024: CM1024Counter Modulo 1024: CM1024

2.2. Counter Modulo 60: DCCM60 Counter Modulo 60: DCCM60

3.3. Counter Modulo 24: DCCM24Counter Modulo 24: DCCM24

4.4. Seven Segment Decode: DEC7Seven Segment Decode: DEC7

Page 6: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 6

Binary CounterBinary Counter

// Binary n bit counterfun Counter(n:int)(incr:net)= (s:net[n], ovfl:net){

c[0]=incr; // carry inovfl=c[n]; // carry outfor (k<n) {s[k] = reg(s[k] ^ c[k]);c[k+1] = s[k] & c[k];}

}

Page 7: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 7

Counter Modulo 60Counter Modulo 60

1.1. Counter Modulo 2: CM2Counter Modulo 2: CM2

2.2. Counter Modulo 3: CM3 Counter Modulo 3: CM3

3.3. Counter Modulo 5: CM5Counter Modulo 5: CM5

Page 8: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 8

Counter Modulo 3Counter Modulo 3i+s0+2s1= c0+2c1 (mod 3)

i s[0] s[1] c[0] c[1] c0 0 00 1 00 0 10 1 11 0 01 1 01 0 11 1 1

0 0 01 0 00 1 0

* * *1 0 00 1 00 0 1* * *

c0 = (1-i)s0+i(1-s0)(1-s1)

c1 = (1-i)s1+i s0 (1-s1)

c = i s1

Page 9: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 9

Counters Counters Modulo 3Modulo 3

Page 10: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 10

Counter Modulo 5Counter Modulo 5ii+s+s00+2s+2s1 1 +4s+4s2 2 = c= c00+2c+2c11+4c+4c2 2 (mod 5)(mod 5)

c = c = ii ss2 2 i s[0] s[1] s[2] c[0] c[1] c[2] c0 0 0 0 0 0 0 00 0 0 1 0 0 1 00 0 1 0 0 1 0 00 0 1 1 * * * *0 1 0 0 1 0 0 00 1 0 1 * * * *0 1 1 0 1 1 0 00 1 1 1 * * * *1 0 0 0 1 0 0 01 0 0 1 0 0 0 11 0 1 0 1 1 0 01 0 1 1 * * * *1 1 0 0 0 1 0 01 1 0 1 * * * *1 1 1 0 0 0 1 01 1 1 1 * * * *

Page 11: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 11

Counter Counter Modulo 5Modulo 5

Page 12: Babylon - École Normale Supérieurejv/HomePage/cours/digitalWatch.pdf · Babylon 1 30 [1 24 51 10]24 51 1060 [42 25 35]60 ... [5] s[6] 00001011111 10000000110 01000111011 11000101111

Sep-02 Digital Systems I – [email protected] 12

Seven Segments CodeSeven Segments Codeb[0] b[1] b[2] b[3] s[0] s[1] s[2] s[3] s[4] s[5] s[6]

0 0 0 0 1 0 1 1 1 1 11 0 0 0 0 0 0 0 1 1 00 1 0 0 0 1 1 1 0 1 11 1 0 0 0 1 0 1 1 1 10 0 1 0 1 1 0 0 1 1 01 0 1 0 1 1 0 1 1 0 10 1 1 0 1 1 1 1 1 0 11 1 1 0 0 0 0 0 1 1 10 0 0 1 1 1 1 1 1 1 11 0 0 1 1 1 0 1 1 1 10 1 0 1 1 1 1 1 1 1 11 1 0 1 1 1 0 1 1 1 10 0 1 1 1 1 0 1 1 1 11 0 1 1 1 1 0 1 1 1 10 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 0 1 1 1 1

B0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15