In my last post about binary signed integers, I introduced the ones complement representation. At the time, I said that the ones complement was found by taking the **bitwise complement** of the number. My explanation about how to do this was simple: invert each bit, flipping 1 to 0 and vice versa. While it’s true that this is all you need to know in order to determine the ones complement of a binary number, if you want to understand how computers do arithmetic with signed integers and why they represent them the way they do, then you need to understand what complements are and how the method of complements allows computers to subtract one integer from another, or add a positive and negative integer, by doing addition with only positive integers.

LIDAR (**LI**ght **D**etecting **A**nd **R**anging) sensors play a critical role in almost all autonomous and semiautonomous vehicles. Using lasers and relatively simple time of flight calculations, LIDAR can very accurately measure distances and generate detailed 3D maps of environments, but traditionally the best performing systems have been large and very expensive. German lighting manufacturer Osram Opto Semiconductors unveiled their new 4 channel LIDAR package last week, and its price and size is set to shake up the market.

In the last post, we saw that one of the major failings of the signed magnitude representation was that addition and subtraction could not be performed on the same hardware as for unsigned integers. As I pointed out, the reason for this is because negating a number in signed magnitude does not yield the additive inverse of that number. The ones complement representation eliminates this issue, although it does introduce new, subtle issues, and [spoiler] doesn’t address the problem of having two representations for zero.

South Korean scientists from the Department of Materials Science and Engineering at Pohang University of Science and Technology appear to have cleared the largest obstacle to the feasibility of building brain-like computers: power consumption. In their paper “Organic core-sheath nanowire artificial synapses with femtojoule energy consumption,” published in the June 17th edition of *Science Advances*, the researchers describe how they use organic nanowire (ONW) to build synaptic transistors (STs) whose power consumption is almost one-tenth of the real thing.

If you’ve just installed the Arduino IDE on Ubuntu, you’ve likely encountered an error similar to the one above the first time you tried to upload a sketch to your board. The error that I specifically get reads:

```
avrdude: ser_open(): can't open device "/dev/tty/ACMO": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
Problem uploading to board. ...
```

I got this error today while doing a fresh install of Arduino 1.6.8 on Ubuntu 15.10, aka Wily Werewolf, but I’ve also run into it on previous Ubuntu versions as well. As I suspect this is not the last time I’ll encounter it, I figure I should write up the solution here instead of having to hunt it down again the next time it stumps me.

Continue reading »

This is going to be another one of my “selfish” posts – written primarily for me to refer back to in the future and not because I believe it will benefit anyone other than me. The idea is one that I always took for granted but had a hard time proving to myself once I decided to try.

**Theorem**: Suppose we have an M bit unsigned binary integer with value A. Consider the first (least significant) N bits with value B. Then:

Put another way, arithmetic with unsigned binary integers of a fixed length N is always performed modulo .

Continue reading »

I previously discussed the signed magnitude solution to representing signed integers as binary strings and pointed out that while it had the advantage of being simple, it also has some disadvantages. For starters, N-bit signed magnitude integers have two representations for zero: positive zero (a bitstring with N zeros) and negative zero (a bitstring with a one followed by N-1 zeros).

There is another significant disadvantage that isn’t obvious until you try to implement signed magnitude representation in silicon. Specifically, you can’t do mathematics with signed magnitude integers using the same hardware as is used for unsigned integers.

We humans and our meat computers don’t have any trouble recognizing the sign of a number. If there is a minus sign, “-,” in front of a number, that number is negative. If a number is prefixed by a plus sign, “+,” or, the more likely case, has no prefix at all, then the number is positive.

Computers of the silicon kind don’t have it so easy. They don’t have the luxury of pluses and minuses to tell them the sign of a number. All they have are zeros and ones, the alphabet of binary systems. So what is their solution?

In keeping in line with their KISS philosophy, the littleBits Arduino module does not offer (easy) access to the full range of analog and digital I/O options that can be found on regular Arduino boards like the Arduino Uno. As a matter of fact, the littleBits Arduino only provides 3 bitSnap inputs and 3 bitSnap outputs if you intend on staying entirely within the littleBits ecosystem. Another difference is that unlike regular Arduino boards, the littleBits version uses its micro USB port for programming only. Power for the module must be supplied via one of the bitSnap inputs.

If you want to use your own sensors or actuators and you don’t have a Perf Module or Proto Module, or if the bitSnap inputs (or outputs as the case may be) are all full, hope is not lost. littleBits recognized that many users would need more I/O and all it takes is a little bit (no pun intended) of soldering.

The littleBits modular electronics system is great for rapidly prototyping electronics circuits, but what happens if you want to use an element, switch, sensor, actuator, etc., for which a module does not exist? Fortunately, littleBits provides three different solutions for the problem. Two of these are ready to go modules: the Proto Module and the Perf Module, while the third are just the connectors you need to roll your own module: the BitSnaps.