Boolean Logic with 555s

The 555 timer IC (which I’ve covered before, but not in depth) is an interesting device. Recently, Jeri Ellsworth wondered on Facebook why the 555 wasn’t used in more designs. One thing led to another, and www.555contest.com was created. It has since really snowballed, and now Jeri, Forrest Mims, and Hans Camenzind (the inventor of the 555) are involved, along with many others. Good times to be an electronics geek, that’s for sure!

I’m a Digital Design geek by nature, so one of the first thoughts that occurred to me was to see if the 555 could be made to do Boolean logic. Looking at the schematic from the datasheet, it became apparent that it could, in fact, implement one (OK, two) of the six universal two-input gates. As it turned out, its specific native gate type is “A * ~B,” (“A AND NOT-B” or, if you like, “B AND NOT-A”) which is one of the two asymmetric universal gates (in other words, good luck finding *that* one as a 74xx chip. Or minimizing for it, for that matter!)

The native "A and NOT B" gate type for the 555

 

Implementing the "A AND NOT-B" gate

A test of the "A AND NOT-B" gate (click image for larger view)

 

“A*~B” gates are, however, universal: they can be combined to make any other type of logic gate. Tying A high, the gate becomes an inverter, which can then be used to make the basic gate into an AND or NOR gate, depending on which input is inverted.

An inverter made from the native A and NOT B gate

 

An AND gate, made from two 555s

 

A NOR gate made from two 555s

Adding a second 555-based inverter on the output creates a NAND or an OR gate, respectively.

This is, of course, an “off-label” use of the 555, so I tried various 555-based gates out in MultiSim. They worked well, so I physically built one of each, just to make sure they really would work that way. I haven’t done XOR and XNOR yet, but they can be made with combinations of the others (OR-and-NAND, and NOR-or-AND, respectively.) Here’s a video.

The circuit starts off (the two blue LEDs on the left) with a pair of 555s, each running in astable mode at a few Hertz each. The leftmost 555 runs at roughly — but not exactly — half the frequency of the second, providing interesting patterns as the two oscillators drift in and out of phase.

The third 555 (first green LED) is an inverter, with the “A” input () tied high, and the input of the faster oscillator tied to the “B” input.

The fourth 555 (second green LED) is a buffer, with the “B” input () tied low. It repeats the logic output of the inverter, and is included mostly because it was easy to do and for completeness.)

The fifth and sixth 555s form a NOR gate (red LED), with the 5th inverting the “A” input of the 6th, making a “NOT A AND NOT B” (NOR) gate.

The 7th and 8th 555s form an AND gate (yellow LED), with the 7th inverting the “B” input of the 8th.

555s 9 though 11 form a NAND gate (white LED; an AND gate with an inverted output).

555s 12 through 14 form an OR gate (purple LED; a NOR gate with an inverted output).

 

Yes, those really are 555s! (Click for larger view)

I’m currently working on a complete working computer made entirely from 555s (and a few diodes, at least for now, to reduce the part count a bit — although strictly speaking, these could be eliminated as well; flip-flops can be constructed from TTL gates. I have most of the design thought out, and hope to have the memory subsection (4 words of 6 bits, including addressing demultiplexer and I/O bus multiplexer) working in time for the 555 contest deadline. The rest of the computer is known to be possible, but unfortunately won’t be done in time for the contest; I’ll have to settle for submitting pieces and a sketch of how the whole thing would work. (Hey, that’s about as far as Babbage got!)

Posted in 555, Digital, Electronics, Nostalgia | 1 Comment

All Over The Map

Here is a Google Maps API static map example, generated from arbitrary data.
A linear path following Broad Street north from City Hall in Philadelphia, PA (USA) was used, but the points could have been taken from .csv data files etc. The points on this map were colored according to their position along the path — but each can be arbitrarily colored from the entire RRGGBB colorspace.

Given its ease of use, lack of cost, and incorporation of road, terrain, or satellite imagery, it looks like a very useful tool for scientific visualization.

The Google Maps API explanation for static maps can be found here.

Here is the HTML code which produced the above map.
(It is shown split into lines for readability, but I found that this seems to break the map API.
When using the API, combine everything into one long line.)

<img src=”http://maps.google.com/maps/api/staticmap?
sensor=false
&size=640×640
&markers=color:0x0000FF|39.953,-75.1633
&markers=color:0x0005F9|39.954,-75.1631
&markers=color:0x000AF4|39.955,-75.1629
&markers=color:0x000FEF|39.956,-75.1627
&markers=color:0x0014EA|39.957,-75.1624
&markers=color:0x0019E5|39.958,-75.1622
&markers=color:0x001EE0|39.959,-75.162
&markers=color:0x0023DB|39.96,-75.1618
&markers=color:0x0028D6|39.961,-75.1616
&markers=color:0x002DD1|39.962,-75.1614
&markers=color:0x0033CC|39.963,-75.1611
&markers=color:0x0038C6|39.964,-75.1609
&markers=color:0x003DC1|39.965,-75.1607
&markers=color:0x0042BC|39.966,-75.1605
&markers=color:0x0047B7|39.967,-75.1603
&markers=color:0x004CB2|39.968,-75.1601
&markers=color:0x0051AD|39.969,-75.1599
&markers=color:0x0056A8|39.97,-75.1596
&markers=color:0x005BA3|39.971,-75.1594
&markers=color:0x00609E|39.972,-75.1592
&markers=color:0x006699|39.973,-75.159
&markers=color:0x006B93|39.974,-75.1588
&markers=color:0x00708E|39.975,-75.1586
&markers=color:0x007589|39.976,-75.1584
&markers=color:0x007A84|39.977,-75.1581
&markers=color:0x007F7F|39.978,-75.1579
&markers=color:0x00847A|39.979,-75.1577
&markers=color:0x008975|39.98,-75.1575
&markers=color:0x008E70|39.981,-75.1573
&markers=color:0x00936B|39.982,-75.1571
&markers=color:0x009966|39.983,-75.1568
&markers=color:0x009E60|39.984,-75.1566
&markers=color:0x00A35B|39.985,-75.1564
&markers=color:0x00A856|39.986,-75.1562
&markers=color:0x00AD51|39.987,-75.156
&markers=color:0x00B24C|39.988,-75.1558
&markers=color:0x00B747|39.989,-75.1556
&markers=color:0x00BC42|39.99,-75.1553
&markers=color:0x00C13D|39.991,-75.1551
&markers=color:0x00C638|39.992,-75.1549
&markers=color:0x00CC33|39.993,-75.1547
&markers=color:0x00D12D|39.994,-75.1545
&markers=color:0x00D628|39.995,-75.1543
&markers=color:0x00DB23|39.996,-75.1541
&markers=color:0x00E01E|39.997,-75.1538
&markers=color:0x00E519|39.998,-75.1536
&markers=color:0x00EA14|39.999,-75.1534
&markers=color:0x00EF0F|40,-75.1532
&markers=color:0x00F40A|40.001,-75.153
&markers=color:0x00F905|40.002,-75.1528
&markers=color:0x00FF00|40.003,-75.1525>

Posted in Coding, Digital, Digital Citizenship, GPS, Internet, Science | Leave a comment

Windows 98 Speed Limit

You learn something every day, I’m told. Apparently today’s lesson is that parts of Windows 98 fall apart when running on a CPU clocked at over 2.1GHz.

Why I’m still running Windows 98 is a long story involving a Robotics class at work and some very old Lego Mindstorms software. At any rate, apparently the NDIS driver in Windows 98 produces a divide-by-zero error if the processor is running faster than 2.1GHz. The symptom is a crash on startup, with a cryptic message about a “Windows Protection Error” when loading the NDIS driver. The error message states that the computer must be restarted — but that won’t help. The machine will boot into Safe Mode, but only because the network drivers aren’t loaded, that way.

Microsoft no longer supports Windows 98, so it took a bit of digging to find the fix. The Windows 98 Q312108 hotfix should patch the NDIS drivers so the divide-by-zero doesn’t occur.

Enjoy!

Posted in Digital, Drexel, Nostalgia, Robotics, System Administration | Tagged , , , , , | 2 Comments

UltraVNC

For a while now, I have used the built-in Remote Desktop functionality in Windows XP and Windows 7. It works well, but I recently came across a limitation. It turns out that when you log in via Remote Desktop, Windows uses a custom “remote desktop” video driver — that disables 3D support, including CUDA.
The workaround I found was to use UltraVNC — a free remote-access solution. It’s slower than Remote Desktop, but doesn’t interfere with the native video drivers (and running three video cards with one monitor is experimental enough, without Windows periodically pulling the drivers out from underneath everything.)

Posted in Digital, System Administration | Leave a comment