Spectre And Meltdown: How Cache Works

The year so far has been filled with news of Spectre and Meltdown. These exploits take advantage of features like speculative execution, and memory access timing. What they have in common is the fact that all modern processors use cache to access memory faster. We’ve all heard of cache, but what exactly is it, and how does it allow our computers to run faster?

In the simplest terms, cache is a fast memory. Computers have two storage systems: primary storage (RAM) and secondary storage (Hard Disk, SSD). From the processor’s point of view, loading data or instructions from RAM is slow — the CPU has to wait and do nothing for 100 cycles or more while the data is loaded. Loading from disk is even slower; millions of cycles are wasted. Cache is a small amount of very fast memory which is used to hold commonly accessed data and instructions. This means the processor only has to wait for the cache to be loaded once. After that, the data is accessible with no waiting.

A common (though aging) analogy for cache uses books to represent data: If you needed a specific book to look up an important piece of information, you would first check the books on your desk (cache memory). If your book isn’t there, you’d then go to the books on your shelves (RAM). If that search turned up empty, you’d head over to the local library (Hard Drive) and check out the book. Once back home, you would keep the book on your desk for quick reference — not immediately return it to the library shelves. This is how cache reading works.

Continue reading “Spectre And Meltdown: How Cache Works”

Local Infrastructure: The Devil Is In The Details

About two months ago I rode my bike to work like any other day, but on the way home a construction project seemed to have spontaneously started at one of the bridges that I pass over. Three lanes had merged into one which, for a federal highway, seemed like a poorly planned traffic pattern for a such a major construction project. As it happens, about an hour after I biked across this bridge that morning both outside sections of the bridge fell into the water. There was no other physical damage that seemed to explain why parts of a bridge on U.S. 1 would suddenly collapse.

The intriguing thing about this bridge collapse was that the outer retaining wall and about half of the sidewalk on both the northbound side and the southbound side had fallen into the water at the same time. This likely wasn’t caused by something like a boat impact, car accident, or an overweight truck. Indeed, Florida Department of Transportation (FDOT) investigated the incident and found that two post tension wires that held these sections of the bridge together had failed, making it unsafe for pedestrians and bicyclists but also for any boaters below. Continue reading “Local Infrastructure: The Devil Is In The Details”

First Light: The Story Of The Laser

Lasers are such a fundamental piece of technology today that we hardly notice them. So cheap that they can be given away as toys and so versatile that they make everything from DVD players to corneal surgery a reality, lasers are one of the building blocks of the modern world. Yet lasers were once the exclusive province of physicists, laboring over expansive and expensive experimental setups that seemed more the stuff of science fiction than workhouse tool of communications and so many other fields. The laser has been wildly successful, and the story of its development is an intriguing tale of observation, perseverance, and the importance of keeping good notes.

Continue reading “First Light: The Story Of The Laser”

Guide: Why Etch A PCB When You Can Mill?

I recall the point I started taking electronics seriously, although excited, a sense of dread followed upon the thought of facing the two main obstacles faced by hobbyists and even professionals: Fabricating you own PCB’s and fiddling with the ever decreasing surface mount footprints. Any resistance to the latter proves futile, expensive, and frankly a bit silly in retrospect. Cheap SMD tools have made it extremely easy to store, place, and solder all things SMD.

Once you’ve restricted all your hobbyist designs/experiments to SMD, how do you go about producing the PCBs needed for prototyping? Personally, I dread the thought of etching my own boards. The process is laborious and involves messy chemicals and specially sensitized PCB’s — none of which interest me. I’ve only ever done it a few times, and have promised myself never to do it again. Professional but cheap PCB manufacturing is more like it board pooling services such as OSH park have made this both easy and affordable — if you can wait for the turnaround.

So what are the alternatives? If you are really serious about swift prototyping from your own Lab, I put forth the case of milling your own PCB’s. Read on as I take you through the typical workflow from design to prototype and convince you to put up with the relatively high start up cost of purchasing a PCB mill.

Continue reading “Guide: Why Etch A PCB When You Can Mill?”

JST Is Not A Connector

When reading about cool projects and products, it’s common to see wiring plugs labelled “JST connector.” This looks fine until we start getting hands-on and begin hacking things together. Inevitably we find the JST connector from one part fails to fit in the JST connector of another. This is the moment we learn “JST” is not a connector specification. It is short for Japan Solderless Terminals Manufacturing Company, Ltd. A company whose history goes back to 1957 and their website (styled in 1999) lists hundreds of different types.

We can simplify to “JST connector” when chit-chatting about projects. But when it comes to actual hardware specification, that’s not good enough. Which JST connector?

Continue reading “JST Is Not A Connector”

3D Printing The Final Frontier

While down here there’s room for debate about the suitability of 3D printing for anything more serious than rapid prototyping, few would say the same once you’ve slipped the surly bonds of Earth. With 3D printing, astronauts would have the ability to produce objects and tools on-demand from a supply of inert raw building materials. Instead of trying to pack every conceivable spare part for a mission to Mars, replacements (assuming a little forward thinking on the part of the spacecraft designers) can be made to order out of the stock of raw plastic or metal kept on-board. The implications of such technology for deep space travel or off-world settlement simply cannot be overstated.

In the more immediate future, 3D printing can be used to rapidly develop and deploy unmanned spacecraft. Tiny satellites (referred to as CubeSats) could be printed, assembled, and deployed by astronauts already in orbit. Innovations such as these could allow science missions to be planned and executed in months instead of years, and at a vastly reduced cost.

Continue reading “3D Printing The Final Frontier”

Truly Terrible Dimensioned Drawings

I’m in the planning stages of a side project for Hackaday right now. It’s nothing too impressive, but this is a project that will involve a lot of electromechanical parts. This project is going to need a lot of panel mount 1/8″ jacks and sockets, vertical mount DIN 5 connectors, pots, switches, and other carefully crafted bits of metal. Mouser and Digikey are great for nearly every other type of electrical component, but when it comes to these sorts of electromechanical components, your best move is usually to look at AliExpress or DealExtreme, finding something close to what you need, and buying a few hundred. Is this the best move for a manufacturable product? No, but we’re only building a few hundred of these things.

I have been browsing my usual Internet haunts in the search for the right bits of stamped brass and injection molded plastic for this project, and have come to a remarkable conclusion. Engineers, apparently, have no idea how to dimension drawings. Drafting has been a core competency for engineers from the dawn of time until AutoCAD was invented, and now we’re finally reaping the reward: It’s now rare to find a usable dimensioned drawing on the Internet.

This post is going to be half rant, half explanation of what is wrong with a few of the dimensioned drawings I’ve found recently. Consider this an example of what not to do.  There is no reason for the state of engineering drawing to be this bad.

Continue reading “Truly Terrible Dimensioned Drawings”