Archive for category Lessons

Binary Lesson 17 – Parity

📅 March 4, 2015
lesson17The word parity originates from the Latin word par, meaning equal. Take the sport of golf, for example. A hole on a golf course is usually assigned a par number. If you sink the golf ball into the hole with the same number of strokes as the par, you are said to be on par — equal to the number of expected strokes. If you expend more strokes than the par, then you need practice, and you should probably try again.

An identical strategy applies to computers. Parity is an early form of error detection often used with serial communications, such as modems and serial ports, for example. An extra bit is appended to each data byte to make the total number of 1 bits even or odd. This extra bit, called the parity bit, is separate from the data byte, and it does not contain data information. It is only used to make the total number of 1 bits even or odd.

There are two main types of parity: Even parity and odd parity. Both operate in the same manner aside from the evenness or oddness.

This lesson focuses on 8-bit data even though the concept can apply to any number of data bits, such as 7-bit ASCII.

Read the rest of this entry »

Leave a comment

Binary Lesson 16 – Binary Logic

lesson16A digital logic gate accepts input and produces a Yes or No output based upon a condition. Examine a light switch with two switches in the pseudo-electronic schematic below.

 

 

a

Demonstration of binary logic AND.

In order for the light to turn on, both switches must be on, but if either switch is turned off or if both switches are turned off, then the light is off.

Read the rest of this entry »

Leave a comment

Binary Lesson 15 – Binary Division

📅 November 18, 2014

lesson15Binary division is an excellent way to practice an understanding of bits and binary values. Is one binary value larger than, smaller than, or equal to another?

This requires a good understanding of the binary place value system, and the better it is memorized, the easier binary division will be.

Also, binary division offers extensive practice with binary subtraction. We saved binary division until after we had introduced at least two methods for binary subtraction because the most involving part of binary division is the subtraction itself.

Sometimes, we must also add a radix point for values not easily divisible by the given number. If this happens, keep in mind that an exact value might not be possible, as in the case of irrational numbers, so it will be necessary to stop at a certain number of digits for a close approximation. The exact point at which this occurs will depend upon experience…or if your fingers get tired, or if you run out of pencil lead, or if you get lost in the seemingly endless series of zeros.

Read the rest of this entry »

Leave a comment

Binary Lesson 14 – Subtraction Using Two’s Complement

November 3, 2014

lesson14In Lesson 10, we saw how to perform binary subtraction using a set of rules for each column of bits.

Now that we have seen how to use signed numbers in binary, we can subtract in binary by performing algebraic addition using the two’s complement method.

Neither technique is more correct than the other. They are two different ways that produce the same result.

Personally, I find the two’s complement method to be easier to compute than the longhand method. It might sound conflicting to “subtract” by “adding,” but that is what we are doing when we add two signed numbers together with opposite signs. (+5) + (-3) = 2, which is the same as 5 – 3 = 2. Same result, but two different thought processes.

Read the rest of this entry »

Leave a comment

Binary Lesson 13 – Signed Binary

October 27, 2014

lesson13If we can express signed values, such as +5 and -5, in decimal, can we do so in binary? Indeed we can!

Signed numbers are either positive or negative in value. If the number is preceded by a minus sign, then the number is negative. If no sign is present or if the number is preceded by a plus sign, then the number is positive.

-5     Negative 5
+5     Positive 5
5      Positive 5 (+ symbol omitted)
-100   Negative 100
8      Positive 8

(The value zero has no sign because nothing is nothing. Therefore, +0 and -0 are pointless.)

We can express signed numbers in binary in the same way, but there are a few points to be aware of to ensure correct mathematical results.

Read the rest of this entry »

Leave a comment

Binary Lesson 12 – One’s Complement and Two’s Complement

October 13, 2014

lesson12One’s complement and two’s complement are two important binary concepts. Two’s complement is especially important because it allows us to represent signed numbers in binary, and one’s complement is the interim step to finding the two’s complement.

Two’s complement also provides an easier way to subtract numbers using addition instead of using the longer, more involving subtraction method discussed in Lesson 10.

We will save the two’s complement subtraction for another lesson, but here, we will look at what these terms mean and how to calculate them.

Read the rest of this entry »

Leave a comment

Binary Lesson 11 – Binary Multiplication

September 25, 2014
lesson11Binary multiplication is performed the same as decimal multiplication. The numbers we are multiplying together are called factors, and the result of multiplication is called the product.

The only challenge comes from multi-row addition, which is facilitated if we perform the addition two rows at a time.
Read the rest of this entry »

Leave a comment