Sunday 19 March 2017

Clock design notes #3 - 16 segment decoders

In the last post I covered how I came up with the logic for some 7 segment decoders. In this post I will brush over the process to make 16 segment decoders to display month and day of week names. I say brush over because it's very much the same process, and I'd just end up repeating myself otherwise, but there are a couple of specifics for the 16 segment decoders so they deserve their own post.

It starts once again by working out a truth table to determine which segments need to be on for any given input value. To help make this process easier, I whipped up a little "character builder" in a spreadsheet, and by setting different cells to 0 or 1 I could turn different segments on or off, and the resulting string of 0's and 1's would go in to the truth table, e.g.:


Unlike 7 segment displays, the segment names you see here may not be standard, they are based on my chosen display from Kingbright, so adjust accordingly if you use different displays.

By fiddling with the character builder I assembled all of the characters necessary for month and day names and planted them in to their respective truth tables, then converted it all in to k-maps with minterms figured out to suit.

The truth tables and k-maps are a bit bigger and more numerous this time around, so instead of posting images here I'll link you to another spreadsheet that contains all of the workings. I've been "strict" again with the month and day of week names in that values beyond those which are required will result in a blank display. e.g. the month counter will be 4 bits, but for values 12-15 my decoders do not produce any output (December is month 11 with January being month 0 - everything in my clock is indexed to 0).

You'll notice in the truth tables that typically segments a and b are the same, as well as e and f, and occasionally some others. So when I did my k-maps, I combined some segments in to the same k-map as they share exactly the same logic to turn them on and off.

To help minimise transistor count I loosened up some of the minterms to overlap with others where possible (the more cells you match the fewer inputs you need to AND and thus the fewer transistors needed), and fed the output of some NOR gates via an inverter in to other NOR gates to minimise some duplication. Perhaps there is room for more optimisation, but I think things are pretty slick as they are and I'm happy with the results.

And like with the 7 segment decoders, the final step was to translate this to logic and simulate it in logicly, and as before I've shared the logicly files for my decoders: day of week decoder, month decoder

Here's a sneak peak at the month decoder, it's by far the biggest of them all, but it does what it says on the tin:


You might need to use a little imagination to see the output on the right, or reference the light bulbs against the segments in the datasheet linked above. But with all zeroes on the input it is displaying "JAN".

And here's a count of transistors and gates that each decoder uses:

  • Day of week decoder: 91 transistors, 54 gates
  • Month decoder: 201 transistors, 101 gates

I don't think theres much else to say, so this is a nice short post. If you want some additional detail and background on how this all came together, check out my post about the 7 segment decoders.

No comments:

Post a Comment