Sunday, April 26, 2015

7 segment decoder

Peeking at memory and using traces is fine, but for output and checking numeric values, 7 segment displays are nice.

Here's a Numitron, a 7 segment incandescent filament display made by RCA in 1970.

"Incandescent light seven-segment display prPNr°17" by D-Kuru - Own work. Licensed under CC BY-SA 3.0 at via Wikimedia Commons 


To display digits on these, you need to convert a binary encoding to the physical layout for the digit positions.

NumberBinarySegments
00000a,b,c,d,e,f
10001a,b
20010a,b,d,e,g
30011a,b,c,d,g
40100b,c,f,g
50101a,c,d,f,g
60110a,c,d,e,f,g
70111a,b,c
81000a,b,c,d,e,f,g
91001a,b,c,d,f,g

There are probably more clever ways to wire this up to reduce the gates and connections required.  For example, the only time segment a is not lit up is for the number 4.  But I'm going to just brute force it and hook up logic for it that says "If all the 1's in the binary number are on AND all the 0's in the binary number are off, then set the signal high for the segments for that number."  As an example, for the number 1, we'll check that bit 0 is on and then use a NOR for bits 1-7 to make sure none of them are on.  If 0 is on and 1-7 are off, then we know that is 00000001 which is the number 1 (base 10).  When that is the case, we'll want to turn the signal on for segments 'a' and 'b' which connect on the right via those OR gates.  Each number that needs to activate a segment attaches to the OR gate for that segment.  So the top OR on the right goes to segment 1 and the bottom one to segment 2.

 With a seven segment display, you can show hexadecimal numbers beyond 0-9 which include a,b,c,d,e,f, but I've only hooked my 7 segment decoder to do 0-9.  Maybe I'll add a-f later.  Below is the full decoder.





No comments:

Post a Comment