Connect with us

9's Complement BCD Thumbwheel Switches

Discussion in 'Electronic Basics' started by Tom2000, Feb 11, 2008.

Scroll to continue with content
  1. Tom2000

    Tom2000 Guest

    I'm helping a guy with a microcontroller project.

    He's going to use some BCD thumbwheels to set a time delay. He
    purchased some at a local surplus store for a buck each. But they
    were 9's complement thumbwheels, not standard decimal-coded switches.

    I'd never heard of 9's complement switches before, but from the truth
    table he sent me, I found that decoding them was no problem. (See
    below)

    My question is this: what sort of equipment might have used these
    switches, and what generation? I read about that system (and
    complement arithmetic in general) on Wikipedia and surmise that they
    might have fed a decimal adder, or somehting like that.

    Has anyone ever encountered these, and on what sort of equipment?
    What were they used for?

    Thanks!

    Tom

    ====================

    Reference:

    Decoding 9's complement thumbwheels

    Truth table:

    1 = closed switch
    0 = open switch

    Switch Setting 8 4 2 1 Complemented Decimal

    0 0 1 1 0 9

    1 0 1 1 1 8

    2 1 0 0 0 7

    3 1 0 0 1 6

    4 1 0 1 0 5

    5 1 0 1 1 4

    6 1 1 0 0 3

    7 1 1 0 1 2

    8 1 1 1 0 1

    9 1 1 1 1 0

    Connect each switch common to ground, then connect the 8, 4, 2, and 1
    switch terminals to the microcontroller using pullup resistors. (That
    active-low arrangement automatically inverts, or complements, each
    switch condition, completing the first step in the decoding process.)

    Read each thumbwheel as a BCD nibble. Subtract that reading from 9 to
    arrive at the decimal switch setting.
     
  2. Tim Wescott

    Tim Wescott Guest

    Something like this would be of use if you were preloading an up-counter
    like, IIRC, a 7490 or 74190. You load the counter, then count up until
    you get a 'carry' output (at 99...99), and voila!, you've counted out
    the number on the switches.

    --

    Tim Wescott
    Wescott Design Services
    http://www.wescottdesign.com

    Do you need to implement control loops in software?
    "Applied Control Theory for Embedded Systems" gives you just what it says.
    See details at http://www.wescottdesign.com/actfes/actfes.html
     
  3. Tom2000

    Tom2000 Guest

    Thanks, Tim. That makes sense.

    Tom
     
  4. Mark Zenier

    Mark Zenier Guest

    Digging out a Fairchild TTL Applications handbook from 1973, they
    show they could be used with the 9310 decimal counters for multistage
    programmable counters. (When Texas Instruments did their version they
    numbered it the 74160). The 74160-63 family are synchronous up counters
    with preset inputs. There is logic in the chip to feed the clock control
    inputs of the next counter in a chain. All chips in the chain get the
    clock pulse in parallel, with a couple of clock control inputs that
    enable the count, or load from the inputs.

    The trick for using a 9's complement input value is that there's an
    extra Nand gate needed that decodes when the counter chain is at 9...98.
    When that happens, instead of the counter going to 9...99, the counter
    chain gets set to the value coming in from the switches. So the
    count runs from the complement value up to the 9...98. Looks like it
    might get a bit wierd if the switch setting is 0...00.

    Mark Zenier
    Googleproofaddress(account:mzenier provider:eskimo domain:com)
     
  5. Tim Wescott

    Tim Wescott Guest

    For most things (certainly if it were used in a frequency synthesizer)
    the first few "digits" would be fixed, with only trailing digits being
    adjustable. That would take care of the '000' case.

    --
    Tim Wescott
    Control systems and communications consulting
    http://www.wescottdesign.com

    Need to learn how to apply control theory in your embedded system?
    "Applied Control Theory for Embedded Systems" by Tim Wescott
    Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
     
  6. Tom2000

    Tom2000 Guest

    Thanks very much, Mark, for the time you spent researching this. And
    I'm amazed that you still have 1973 data books on the shelf! (Amazed
    in a jealous sort of way. I wish I'd kept a lot of stuff from that
    era.)

    That's sort of the circuitry I was expecting after I'd read that Wiki
    article.

    Best,

    Tom
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-