One Day Builds — Enigma Machine Emulator

Enigma Machine By Alessandro Nassiri CC BY-SA 4.0

I went to Bletchley Park last week for a fascinating day trip. Bletchley Park was the location where the British code breakers were based during World War II. It was from here that Alan Turing and many other incredibly gifted mathematicians, statisticians, and translators worked tirelessly throughout the war to continuously crack and decrypt the messages sent by the Germans.

During the war the Germans used several variants of an electro-mechanical rotatory cipher machine known as the Enigma machine. The Germans believed the encryption generated by these machine to be unbreakable. Theoretically there were in the order of 1.07 x 10²³ possible combinations for the Wehrmacht (Army) version of the machine. Fortunately (for the Allied forces) a weakness in the encryption method could be exploited and using a clever technique, alongside a custom build electro-mechanical device known as the Bombe, the message could be decrypted.

To learn a bit more about how the Enigma machine worked I decided to make an Enigma Machine Emulator in C. Read More

One Day Builds — FPGA Pong

Since I hardly ever post anything to this website I’ve decided to submit a few projects in a slightly different format. At the moment every time I have a day free to do some electronics the thought of fully documenting the project and posting it on here puts me off!

Instead, from now on, I’m going to do a series of one day builds where I have a singe day (or less) to make a specific project. I’ll use this website like a lab book, documenting my progress as I go along. The notes will be rough but there should be enough detail to follow what I’ve done. I hope someone finds them useful/interesting.

10:45 Research VGA interface and timing specifications

There are 5 main signals for VGA: * 3 Analogue signals for the Red, Blue, and Green pixel intensities. * 2 Digital signals: Horizontal sync and Vertical sync.

H sync and V sync tell the monitor where the horizontal and vertical lines begin and end. See diagram below for details:

11:30 Work out timings for my monitor

The timings of VGA signals depends on the desired resolution and refresh rate.

My monitor has a native resolution of 1680 x 1050 resolution and supports a 60Hz refresh rate. VGA timings can be a bit awkward to calculate so it is often easier just to look them up online.

I used this site which has a large selection of common resolutions.

The horizontal width in pixels = “Front porch” width + “Sync pulse” width + “Back porch” width + monitor width. For my chosen resolution is 104 + 184 + 288 + 1680 = 2256.

The vertical width in pixels is = “Front porch” width + “Sync pulse” width + “Back porch” width + monitor width. For my chosen resolution is 1 + 3 + 33 + 1050 = 1087.

The h_sync line should be normally high, and then pulsed low for 184 pixels to trigger the h_sync. The v_sync line should be normally low, and then pulsed high for 3 pixels to trigger the v_sync.

To get a refresh rate of 60Hz I need a pixel clock of 147.14MHz. This is calculated from: h_width * v_width * refresh rate = 2256 * 1087 * 60 = 147136320Hz Read More