# Patterns: Yin and Yang

How many programmers whine that C is dangerous because of memory leaks? How many programmers rely on IDEs because they can't keep track of how many layers of brackets they're using? All of this stress is easily defeated with a little bit of Eastern Philosophy. Yin: Beginnings In the binary unifying force of the cosmos, there are

# CS 101 – Evolution of Programming

Programming makes our lives easier, but most people don't fully understand how much easier. Programming began with gears That's right, folks. Long ago, when you wanted to do math quickly, you had to use something like an abacus or slide rule. Sure, you had geniuses like Babbage with his mechanical adding machine, but these were very

# CS 101 – On the Clock

In my last post, I alluded to the topic of this post. Sorry about that. I usually like to lay the groundwork and build on it, but I got a bit carried away. In best practice, we should avoid leaning on information we have not yet provided. Static and Dynamic Before we can discuss the clock,

# CS 101 – Floating Point Binary

This section should wrap us up on binary for now. Floating Point Numbers Up until this point, we have dealt exclusively with integer representation binary. Everything we have done has been a whole value, with no fractions. Floating point numbers are those fractions. More accurately, it is a number whose values can be between one and zero.

# CS 101 – Integer Representation

Apologies for the title, but I can't think of a better way to put it. Unsigned The simplest way to handle integers in binary is to treat every number as a positive number. This is called the unsigned integer representation. With the exception of subtraction, studied earlier, we have always used the unsigned integer representation before. Sign-Magnitude Naturally,

# CS 101 – Registers

We now have some understanding of what bits are and how we work with them, but how do we store them? Registers A register is a computer element which stores bytes of data. There are several ways to build these registers, but their core function is to hold onto data for future use. Consider the following pseudocode: a

# CS 101 – Bytes and ASCII

(Apologies for the relatively content-free submission, but my buffer ran dry. This is a bit of a rushed post.) We have seen that a computer represents data as binary bits. These bits are commonly grouped into eight-bit units, which we call bytes. One byte can store up to 256 possible values. These values (in this case,

# CS 101 – Binary Mathematics

In my last post, we discovered binary as a form of numeric representation. Like decimal, we can perform basic arithmetic operations with binary (and, consequently, hex). Addition We all know that 1 + 1 = 2, right? In binary, 1 + 1 = 10, as 10 is the binary representation of 2. By the same token,

# CS 101 – Binary and Hexadecimal

You may have heard the old programmer's joke: There are 10 kinds of people in this world: Those who understand Binary, And those who don't. This is an excellent introduction into the topic. Binary Computers, being dumb machines, are composed primarily of a host of switches. These switches have two states: ON and OFF (or CLOSED and OPEN). When the