Create A Full Adder Using The C Preprocessor

Full_Adder

[Phillip] wanted to play with the C preprocessor. He decided to do that by creating a 4 bit full adder. We know this is pretty useless in everyday life, but it was a great learning experience. The beauty of this adder is right at the start. [Phillip] defines truth tables for XOR and AND. He’s able to then create strings that reference these truth tables.
For example: the first line of [Phillip’s] AND table is #define AND_00 0. If the preprocessor concatenates strings that equal “AND_00” they will then be converted to 0. This is the groundwork for the half adder .

The next step is the operational logic, which of course falls upon macros:


/* Full adder macros */
/* Out = (A ^ B) ^ cin */
#define FULL_ADD_OUT( a, b, cin ) \
 XOR( XOR( a, b ), cin )

/* Carry_out = (A & B) ^ (Carry_in & (A ^ B)) */
/* The standard adder uses OR for the last 'gate' - this
 can safely be changed  to XOR, which has been done here
 to avoid defining an OR operator */
#define FULL_ADD_CARRY( a, b, cin ) \
 XOR( AND( XOR( a, b ), cin ), AND( a, b ) )

Continue reading “Create A Full Adder Using The C Preprocessor”

Steam Controller: Open And Hackable?

SteamController

The folks over at Valve Corporation have been busy. Just this week they have made three announcements regarding the future of their company; SteamOS, a linux-based operating system, Steam Machines (for running SteamOS), and the one we’re most interested in, the Steam Controller, an open controller. Not to worry though, the controller is not exclusive to the Steam Machines!

This is why we’re intrigued:

The Steam Controller was designed from the ground up to be hackable … We plan to make tools available that will enable users to participate in all aspects of the experience, from industrial design to electrical engineering.

We’re curious to see what that exactly means, but it definitely sounds promising! We know that Valve already takes in tons of customer feedback through their Steam Community and Workshop contributors, but how open is this controller really going to be? To read more about it as the information unfolds, check out the topics in the Steam Universe forum.

If you’re interested in joining the hardware beta, head on over here, but space is very limited.

[Thanks Adam!]

UTF-8 – “The Most Elegant Hack”

While it may not look like much, the image above is a piece of the original email where [Ken Thompson] described what would become the implementation of UTF-8. At the dawn of the computer age in America, when we were still using teletype machines, encoding the English language was all we worried about. Programmers standardized on the ASCII character set, but there was no room for all of the characters used in other languages. To enable real-time worldwide communication, we needed something better. There were many proposals, but the one submitted by [Ken Thompson] and [Rob ‘Commander’ Pike] was the one accepted, quite possibly because of what a beautiful hack it is.

[Tom Scott] did an excellent job of describing the UTF-8. Why he chose to explain it in the middle of a busy cafe is beyond us, but his enthusiasm was definitely up to the task. In the video (which is embedded after the break) he quickly shows the simplicity and genius of ASCII. He then explains the challenge of supporting so many character sets, and why UTF-8 made so much sense.

We considered making this a Retrotechtacular, but the consensus is that understanding how UTF-8 came about is useful for modern hackers and coders. If you’re interested in learning more, there are tons of links in this Reddit post, including a link to the original email.

Continue reading “UTF-8 – “The Most Elegant Hack””

Classic PDA Finds Second Life As A Network Touch Screen Display

pocketviewer

[Tomas Janco] had an old Casio Pocket Viewer PDA collecting dust. Rather than throw it away, He decided to re-purpose it as a display for time, weather, and the current status of his garage door.

The Casio Pocket Viewer was a competitor to the Palm Pilot. The two systems even shared the same LCD resolution – 160×160 monochrome. [Tomas’] particular model is an S660, sporting 6 megabytes of ram and an NEC V30MZ (Intel 8086 compatible) processor. Similar to Palm, Casio made an SDK freely available.

The SDK is still available from Casio, and [Tomas] was able to get it running on his PC. Development wasn’t without pitfalls though. The Pocket Viewer SDK was last updated in April of 2001. Software is written in C, but the then new C99 standard is not supported. The SDK does include a simulator and debugger, but it too is not as polished as todays systems – every simulator startup begins with setting the clock and calibrating the touch screen. Keep reading after the jump to learn about the rest of the hurdles he overcame to pull this one off.

Continue reading “Classic PDA Finds Second Life As A Network Touch Screen Display”

The Nibbler: A 4-bit CPU Built With 7400 Logic

nibbler-schematic

Maybe we shouldn’t say “built” since [Steve Chamberlin] hasn’t actually heated up his iron yet. From the finished schematic above that is puzzling at first, until you realize the scope of the project. His Nibbler implements a 4-bit CPU using 7400 logic chips. Because he’s come up with the architecture himself he’s taking a lot of steps to check all of his work before committing to a PCB.

We linked to his category for the project which is still in progress. Most recently he wrote a program to prove that it’ll run on the hardware. That’s a feat considering this is still just a design idea. It was made possible because he wrote a simulator based on the design. The C++ tool simulates data and control buses and features a full set of debugging tools.

Careful testing of the design before the build is the best possible way to go. The simulator and debugging tools will be useful for software development even after the hardware is built. And testing before wiring is a must as these things get out of control quickly in terms of soldering complexity.

[via Dangerous Prototypes]

Make Your Treadmill More Entertaining For $0

Treadmill Computer

Treadmills can often be found on the side of the road, after someone gave up on their running regimen and found that the machine was taking up too much space in their basement. This is great for hackers, since they have some useful parts in them.

However, if you’d like to actually use a treadmill for running, some entertainment would certainly help. [KingJackOff] decided to roll his own treadmill entertainment system out of things he had lying around, bringing the total cost to $0.

He took an old laptop and mounted it in a piece of rigid foam using a gratuitous amount of duct tape. With the screen and keyboard mounted, he added speakers and a slot for the DVD drive. Then a printed graphic was taped to the front, with a nice motivational message.

Lots of people have old laptops lying around with mechanical issues. Broken hinges and frames make them unusable, even though the electronics are fine. Some foam and paper could be all you need to bring one back to life.

[via Reddit]

A PC Rig That Belongs On The Wall Of An Art Museum

When Overclock.net user [Show4Pro] decided to upgrade his “old dusty rig”, he eschewed the conventional PC form factor and instead built an incredibly sexy custom wall-mounted case.

The six sticks of RAM, quad HDD/SSDs, and dual Radeon HD7970s are enough to make all but the most hard core gamer blush, but that was only the beginning here.  Using a Dremel tool, Show4Pro cut the frame from a piece of hardboard and coated it with a mock-carbon fiber vinyl sheet.  This backdrop acts to both hide the (many) cables and provide structural support to the components.  Custom light guides cut from an acrylic sheet are back lit with LEDs and serve as a border for each of the components.

Laying all of the boards flat on the frame required the use of PCIe risers to move the video cards away from the mother board.  Long PCIe connectors are very susceptible to EMI though, and Show4Pro ran into a few stability problems that he eventually had to resolve with some high-end shielded risers.

Besides that one minor hiccough, the project went off without a hitch and it looks like his 100+ hours of work have really paid off.

Via Reddit.