How to Build a Computer 20: Digital Watches

 

Because I’m the sort of simian who still thinks that digital watches are pretty neat, I figured I’d work through a practical example. We know how to represent binary numbers, and we know how to express logic with gates. That’s enough knowledge to be dangerous. From there I worked out how to light the lights on a digital watch face. Here, let me show you. But first a quick disclaimer. This isn’t my area of expertise; odds are there are plenty of ways to do this better or more efficiently. I can say at least that this one works.

Okay, let’s talk numbers. Recall from the discussion of binary that you can express any normal number as a series of ones and zeros. So, for example, you could draw One (that is, the presence of bread) in the 4’s place, one in the 2’s place, one in the 1’s place. 4 + 2 + 1 = 7

We’re assuming that we’ve got the input signal. What we’re trying to do then is work out the logic to change that binary number into a recognizable digit. Here’s how the logic looks in Excel:

Actually I made this at the end of the process, after I’d worked out all the intervening logic. And then had to work it out again when it became apparent that I’d screwed most of it up.

That’s a five (Yeah, the contrast could be better). We’ve got four input wires and we’ll make ten digits out of the combination of them. To get from the one to the other you’ve got to work out the logic. For reference here’s the first ten numbers in binary:

Forgetting that there’s a zero (upper left) is part of why I had to rework my logic.

I’m going to assume you’ve spent mornings staring balefully at an alarm clock that just wouldn’t quit beeping, so I’m not going to also go over the different lights in the number. Let’s work through the logic for the top light (marked “A” in the picture.)

It’s off for 1, on for 2 and 3, off for 4, on for five, six, seven, eight and nine. Oh, and on when all the signals are off; that zero thing again. So we need it on whenever the input number isn’t 1 or 4. Look at those numbers in binary. If only the 1’s spot or the 4’s spot is on then the light is off, otherwise it’s on. From that we can work out a couple rules immediately:

  • If the eight’s place is on (8 or 9) then the light is on.
  • If the two’s place is on you’re also good (2, 3, 6, 7)
  • If nothing’s on (0) then the light is on.

That leaves only one number that isn’t covered; 5. If both the ones spot and the 4’s spot is on then we need to have the light on, but not if it’s only one. Rephrase that, and append it to the rules. The light is on if:

  • 4 AND 1
  • 8 OR 2
  • NOT (1 OR 2 OR 4 OR 8)

If any one of those conditions is true you’re looking at a digit that’s neither 4 nor 1, and hence that top light should be on. You can draw that out with three gates (an AND, an OR, and a NOR). You know what? I’ll cut to the chase. Here’s a drawing of the individual lights and the logic circuits you could use to get there:

The colored lines aren’t standard; I put them there that way so it’s easier to follow the logic. Also because drawing all those little bridges got annoying.

If you want to try this on your own, hey, go ahead. You’ve got all the tools to do it. But largely because I like hearing the sound of my own voice here’s how that Excel sheet works, with the formulas showing:

You might not think it looking at those formulae, but there’s a point where even I won’t bother fixing a formula that’s too complicated.

Start from cell B4. That’s the input number. The formulae in C4 to F5 are all to convert the decimal number into binary. The green and pink conditional formatting is for formula that resolve to TRUE and FALSE respectively. The number on the right is also done with conditional formatting. The individual cells link back to the formula (as designated by the letter.)

I hope you had fun with this because absolutely none of it will be on your test. Just one of those things when you’re learning things. You can read about it all day long but somehow you never make the connection between abstract knowledge and practical problem-solving. Once I realized I could solve this problem we were doomed to this quick jaunt through. We’ll return to our slow march through the basic logic required to turn electrons into the stuff that dreams are made of. Join us next week for “The Latch Racket” or “Someone help me find my keys already”.

This is part twenty of my ongoing series on building a computer, the ‘ya dere hey’ way. You may find previous parts under the tag How to Build a Computer. This week’s post has been brought to you by Vincent Price. A simple little matter like sponsorship from beyond the grave is nothing to Vincent Price!

[First – Silicon] [Previous – Logic Gates] [Next — Latches]

Published in Science & Technology
This post was promoted to the Main Feed by a Ricochet Editor at the recommendation of Ricochet members. Like this post? Want to comment? Join Ricochet’s community of conservatives and be part of the conversation. Join Ricochet for Free.

There are 29 comments.

Become a member to join the conversation. Or sign in if you're already a member.
  1. Arahant Member
    Arahant
    @Arahant

    Hank Rhody, Red Hunter: Forgetting that there’s a zero (upper left) is part of why I had to rework my logic.

    The full picture is not showing unless one does the “View Image” thing.

    • #1
  2. Al French, sad sack Moderator
    Al French, sad sack
    @AlFrench

    No cheese?

    • #2
  3. OldDanRhody Member
    OldDanRhody
    @OldDanRhody

    Arahant (View Comment):

    Hank Rhody, Red Hunter: Forgetting that there’s a zero (upper left) is part of why I had to rework my logic.

    The full picture is not showing unless one does the “View Image” thing.

    I can see it if I go full-screen with the browser window.
    The sidebars are too wide.

    • #3
  4. Hank Rhody, Red Hunter Contributor
    Hank Rhody, Red Hunter
    @HankRhody

    Al French, sad sack (View Comment):

    No cheese?

    On toast? What are you, a…

    Now that you mention it though…

    • #4
  5. Judge Mental Member
    Judge Mental
    @JudgeMental

    I assume the black toaster does Darth Vader.

    • #5
  6. Hank Rhody, Red Hunter Contributor
    Hank Rhody, Red Hunter
    @HankRhody

    OldDanRhody (View Comment):

    Arahant (View Comment):

    Hank Rhody, Red Hunter: Forgetting that there’s a zero (upper left) is part of why I had to rework my logic.

    The full picture is not showing unless one does the “View Image” thing.

    I can see it if I go full-screen with the browser window.
    The sidebars are too wide.

    I moved the photo from ‘full size’ to large. In the editing window ‘full size’ autoadjusts down to the width of the post. Evidently it doesn’t in the actual post.

    • #6
  7. Gary McVey Contributor
    Gary McVey
    @GaryMcVey

    Digital watches were still so novel in 1973 that a light up red LED watch got a surprise laugh when James Bond checks it in bed in “Live or Let Die”. I never realized that each facet of each digit has its own archipelago of logic gates, and each unit of those gate systems is itself made of a number of transistors. It does get to be like going to St. Ives, with all of the attendant wives, maids, cats, kittens; the complexity within complexity is daunting. 

    See the collected works of Rhody, H. on fractal complexity. 

    In fact, this series, plus a few sidebar mindbenders of Hank’s has got to be one of the finest reasons for being on Ricochet. This absolutely must have some kind of preserved life beyond even this venerable website. It’s already book length; you gotta make a book. 

    • #7
  8. Judge Mental Member
    Judge Mental
    @JudgeMental

    Gary McVey (View Comment):

    Digital watches were still so novel in 1973 that a light up red LED watch got a surprise laugh when James Bond checks it in bed in “Live or Let Die”. I never realized that each facet of each digit has its own archipelago of logic gates, and each unit of those gate systems is itself made of a number of transistors. It does get to be like going to St. Ives, with all of the attendant wives, maids, cats, kittens; the complexity within complexity is daunting. 

     

    Then once you get the hardware up to the point where it’s actually a computer, the same thing starts all over with the software.  Layer upon layer upon layer…

    • #8
  9. Gary McVey Contributor
    Gary McVey
    @GaryMcVey

    (leans back in the rocking chair, tugs thoughtfully on a corncob pipe. Distant sound of a hound dog barking.)

    “Why, son, back in my day we didn’t mess with all this complexity. We used Nixie tubes! Just put a volt into pin 7 and the number 7 lit up.” 

    • #9
  10. Hank Rhody, Red Hunter Contributor
    Hank Rhody, Red Hunter
    @HankRhody

    Judge Mental (View Comment):

    Gary McVey (View Comment):

    Digital watches were still so novel in 1973 that a light up red LED watch got a surprise laugh when James Bond checks it in bed in “Live or Let Die”. I never realized that each facet of each digit has its own archipelago of logic gates, and each unit of those gate systems is itself made of a number of transistors. It does get to be like going to St. Ives, with all of the attendant wives, maids, cats, kittens; the complexity within complexity is daunting.

     

    Then once you get the hardware up to the point where it’s actually a computer, the same thing starts all over with the software. Layer upon layer upon layer…

    When I started this series I had the ambition to follow the fractal all the way down. Turns out that was just as foolish as it sounds.

    • #10
  11. Gary McVey Contributor
    Gary McVey
    @GaryMcVey

    Hank’s night club is a unique experience. The Moebius strippers are simultaneously clothed and unclothed. Every bottle behind the bar is a Klein bottle, each of which is both inside and outside of all of the rest of the bar, including all of the other Klein bottles. And don’t get me started on those M.C. Escher staircases. 

    • #11
  12. Belt Inactive
    Belt
    @Belt

    This takes me right back to my sophomore ‘Digital Logic’ course in college.  I think this was the second or third homework assignment we did.

    Nice job using Excel to illustrate the process, BTW.

    • #12
  13. GLDIII Reagan
    GLDIII
    @GLDIII

    We were promised “how to” for modern digital computers, instead we are getting chintzy 35 year old “what for” LED wrist watches.   –NYTimes review

    • #13
  14. Basil Fawlty Member
    Basil Fawlty
    @BasilFawlty

    I still miss my old flip clock. I got one after visiting the recently-opened Dulles Airport and seeing flip clocks everywhere you looked. It was my first encounter with digital timepieces.

    • #14
  15. GLDIII Reagan
    GLDIII
    @GLDIII

    How the heck did this egg-headed drivel ever get to the main feed? -NYTimes Review

    • #15
  16. GLDIII Reagan
    GLDIII
    @GLDIII

    Basil Fawlty (View Comment):

    I still miss my old flip clock. I got one after visiting the recently-opened Dulles Airport and seeing flip clocks everywhere you looked. It was my first encounter with digital timepieces.

    Early 60’s. Did they have LED driven displays back then?

    My first time to Dulles was in 1972′ for the Transpo Exhibition.  Even then we had fantasies on doing high speed trains.

    • #16
  17. Basil Fawlty Member
    Basil Fawlty
    @BasilFawlty

    GLDIII (View Comment):

    Basil Fawlty (View Comment):

    I still miss my old flip clock. I got one after visiting the recently-opened Dulles Airport and seeing flip clocks everywhere you looked. It was my first encounter with digital timepieces.

    Early 60’s. Did they have LED driven displays back then?

    My first time to Dulles was in 1972′ for the Transpo Exhibition. Even then we had fantasies on doing high speed trains.

    I’m sure they would have used LEDs for the clocks had they been available. Keeping all those electromechanical flip-clocks synchronized and running must have been quite a job.

    I remember the long ride out to the new airport on the almost-deserted four-lane access road. The surrounding countryside was pitch black until you suddenly came upon that glowing Saarinen spaceport sitting there alone in the middle of nowhere. Yes, people actually drove to Dulles just to see it.

    • #17
  18. Gary McVey Contributor
    Gary McVey
    @GaryMcVey

    Basil Fawlty (View Comment):

    GLDIII (View Comment):

    Basil Fawlty (View Comment):

    I still miss my old flip clock. I got one after visiting the recently-opened Dulles Airport and seeing flip clocks everywhere you looked. It was my first encounter with digital timepieces.

    Early 60’s. Did they have LED driven displays back then?

    My first time to Dulles was in 1972′ for the Transpo Exhibition. Even then we had fantasies on doing high speed trains.

    I’m sure they would have used LEDs for the clocks had they been available. Keeping all those electromechanical flip-clocks synchronized and running must have been quite a job.

    I remember the long ride out to the new airport on the almost-deserted four-lane access road. The surrounding countryside was pitch black until you suddenly came upon that glowing Saarinen spaceport sitting there alone in the middle of nowhere. Yes, people actually drove to Dulles just to see it.

    Seven Days in May, filmed in 1963 and released the following year, has a scene at Dulles that plays up its futuristic look. Even forty years later it was still pretty impressive. I haven’t seen it in a while. 

    • #18
  19. Basil Fawlty Member
    Basil Fawlty
    @BasilFawlty

    Gary McVey (View Comment):

    Basil Fawlty (View Comment):

    GLDIII (View Comment):

    Basil Fawlty (View Comment):

    I still miss my old flip clock. I got one after visiting the recently-opened Dulles Airport and seeing flip clocks everywhere you looked. It was my first encounter with digital timepieces.

    Early 60’s. Did they have LED driven displays back then?

    My first time to Dulles was in 1972′ for the Transpo Exhibition. Even then we had fantasies on doing high speed trains.

    I’m sure they would have used LEDs for the clocks had they been available. Keeping all those electromechanical flip-clocks synchronized and running must have been quite a job.

    I remember the long ride out to the new airport on the almost-deserted four-lane access road. The surrounding countryside was pitch black until you suddenly came upon that glowing Saarinen spaceport sitting there alone in the middle of nowhere. Yes, people actually drove to Dulles just to see it.

    Seven Days in May, filmed in 1963 and released the following year, has a scene at Dulles that plays up its futuristic look. Even forty years later it was still pretty impressive. I haven’t seen it in a while.

    I remember the futuristic Dulles phone booths were shown in the movie. Next time I watch it, I’ll have to keep an eye out to see if any of the flip-clocks are visible.

    • #19
  20. GLDIII Reagan
    GLDIII
    @GLDIII

    Gary McVey (View Comment):

    Basil Fawlty (View Comment):

    GLDIII (View Comment):

    Basil Fawlty (View Comment):

    I still miss my old flip clock. I got one after visiting the recently-opened Dulles Airport and seeing flip clocks everywhere you looked. It was my first encounter with digital timepieces.

    Early 60’s. Did they have LED driven displays back then?

    My first time to Dulles was in 1972′ for the Transpo Exhibition. Even then we had fantasies on doing high speed trains.

    I’m sure they would have used LEDs for the clocks had they been available. Keeping all those electromechanical flip-clocks synchronized and running must have been quite a job.

    I remember the long ride out to the new airport on the almost-deserted four-lane access road. The surrounding countryside was pitch black until you suddenly came upon that glowing Saarinen spaceport sitting there alone in the middle of nowhere. Yes, people actually drove to Dulles just to see it.

    Seven Days in May, filmed in 1963 and released the following year, has a scene at Dulles that plays up its futuristic look. Even forty years later it was still pretty impressive. I haven’t seen it in a while.

    Still has the cool looks factor, but it is a PITA logistically, both to get there, and getting from the checkin to the remote gates. I won’t use the place unless it has a super deal ($$) on oversea travel. Dulles was designed in a more civilized era still tied to traveling in one’s Sunday best and at a more leisurely pace. It has not done well in the post deregulated frenzy unleashed by Alfred Kahn.

    Interior view of a commercial passenger plane shows, in the foreground, a couple as they enjoy their meal next to a smiling elderly woman, while behind them, a flight attendant pours a glass of wine for a man who sits next to a couple who toast each other with full glasses, 1950s. (Photo by Frederic Lewis/Getty Images)

    First Jet Service

    NEW YORK – MID 1950’s: An air hostess chats with passengers on a Transocean Air lines Boeing 377 Stratocruiser in the mid 1950’s. Transocean Air lines flew between 1946 and 1962 and was a pioneer discount airline. (Photo by Michael Ochs Archive/Getty Images)

    • #20
  21. Arahant Member
    Arahant
    @Arahant

    Basil Fawlty (View Comment):
    Yes, people actually drove to Dulles just to see it.

    Well, if you like to see ugly architecture, Eero was your man.

    • #21
  22. Basil Fawlty Member
    Basil Fawlty
    @BasilFawlty

    Arahant (View Comment):

    Basil Fawlty (View Comment):
    Yes, people actually drove to Dulles just to see it.

    Well, if you like to see ugly architecture, Eero was your man.

    Some of it may have been ugly, but he redeemed himself at the finnish.

    • #22
  23. Arahant Member
    Arahant
    @Arahant

    Basil Fawlty (View Comment):
    Some of it may have been ugly, but he redeemed himself at the finnish.

    So, so bad.

    • #23
  24. Judge Mental Member
    Judge Mental
    @JudgeMental

    Arahant (View Comment):

    Basil Fawlty (View Comment):
    Some of it may have been ugly, but he redeemed himself at the finnish.

    So, so bad.

    So, there was a clever pun involved?  I don’t get the reference, but I wondered.

    • #24
  25. Arahant Member
    Arahant
    @Arahant

    Judge Mental (View Comment):
    So, there was a clever pun involved?

    I wouldn’t say clever, but it was a pun. Eero Saarinen was Finnish. His father, Eliel, was a good architect.

    • #25
  26. Basil Fawlty Member
    Basil Fawlty
    @BasilFawlty

    Arahant (View Comment):
    I wouldn’t say clever, but it was a pun.

    Everyone’s a critic.

    • #26
  27. Gary McVey Contributor
    Gary McVey
    @GaryMcVey

    Basil Fawlty (View Comment):

    Gary McVey (View Comment):

    Basil Fawlty (View Comment):

    GLDIII (View Comment):

    Basil Fawlty (View Comment):

    I still miss my old flip clock. I got one after visiting the recently-opened Dulles Airport and seeing flip clocks everywhere you looked. It was my first encounter with digital timepieces.

    Early 60’s. Did they have LED driven displays back then?

    My first time to Dulles was in 1972′ for the Transpo Exhibition. Even then we had fantasies on doing high speed trains.

    I’m sure they would have used LEDs for the clocks had they been available. Keeping all those electromechanical flip-clocks synchronized and running must have been quite a job.

    I remember the long ride out to the new airport on the almost-deserted four-lane access road. The surrounding countryside was pitch black until you suddenly came upon that glowing Saarinen spaceport sitting there alone in the middle of nowhere. Yes, people actually drove to Dulles just to see it.

    Seven Days in May, filmed in 1963 and released the following year, has a scene at Dulles that plays up its futuristic look. Even forty years later it was still pretty impressive. I haven’t seen it in a while.

    I remember the futuristic Dulles phone booths were shown in the movie. Next time I watch it, I’ll have to keep an eye out to see if any of the flip-clocks are visible.

    A good flip clock shot: the opening montage of Rocky III, set to “Eye of the Tiger”. It’s also just a damned good, clever montage, using real shots of Sylvester Stallone’s early years of fame to depict Rocky Balboa’s rise. 

    • #27
  28. Arahant Member
    Arahant
    @Arahant

    You want to talk about flip clocks?

    • #28
  29. Basil Fawlty Member
    Basil Fawlty
    @BasilFawlty

    Let’s get back to technology:

    • #29
Become a member to join the conversation. Or sign in if you're already a member.