• We are familiar with numbers based on units of 10, a result of our 10 fingers. But, other number bases are possible.

• When using digital systems, we will use a variety of numbering systems (other than in units of 10).

• With computers, number bases that are multiples of 2 are favored.

• For each base we count as usual, but the numbers stop at some value, then a more significant digit is added.

• Binary is best used in computers because signals are ON/OFF which is well suited to the two binary digits.

• Converting between number systems can be done by looking at digit magnitude.

• Conversion can also be done between systems by division.

• For division use remainders.

• Convert the following numbers to/from binary

• Binary bytes and words are shown below.

• In most discrete systems the inputs and outputs (I/O) are either on or off. This is a binary state that will be represented with,

• Because there are many inputs and outputs, these can be grouped (for convenience) into binary numbers.

• Consider an application of binary numbers. There are three motors M1, M2 and M3

100 = Motor 1 is the only one on

in total there are 2n or 23 possible combinations of motors on.

• The most common Binary operations are,

• These include standard logic forms such as,

• Negative numbers are a particular problem with binary numbers. As a result there are two common numbering systems use,

signed binary: the most significant bit (MSB) of the binary number is used to indicate positive/negative

2s compliment: negative numbers are represented by complimenting the binary number and then adding 1.

• Signed binary numbers are easy to understand, but much harder to work with when doing calculations.

• An example of 2s compliments are given below,

• When adding 2s compliment numbers, additional operations are not needed to deal with negative numbers. Consider the examples below,

• Each digit is encoded in 4 bits

• This numbering system makes poor use of the digits, but is easier to convert to/from base 10 numbers. For the two bytes above the maximum numbers possible are from 0-9999 in BCD, but 0-64285 in binary.

• Convert the BCD number below to a decimal number,

• Convert the following binary number to a BCD number,

• Convert the following binary number to a Hexadecimal value,

• Convert the following binary number to a octal,

• While numbers are well suited binary, characters don’t naturally correspond to numbers. To overcome this a standard set of characters and controls were assigned to numbers. As a result, the letter ‘A’ is readily recognized by most computers world-wide when they see the number 65.

• Parity: used to detect errors in data. A parity bit can be added to the data. For example older IBM PCs store data as bytes, with an extra bit for parity. This allows real-time error checking of memory.

• The odd parity bit is true if there are an odd number of bits on in a binary number. On the other hand the Even parity is set if there are an even number of true bits.

• Convert the decimal value below to a binary byte, and then determine the odd parity bit,

• A scheme to send binary numbers, but encoded to be noise resistant.

• The concept is that as the binary number counts up or down, only one bit changes at a time. Thus making it easier to detect erroneous bit changes.

ASIDE: When the signal level in a wire rises or drops, it induces a magnetic pulse that excites a signal in other nearby lines. This phenomenon is known as ‘cross-talk’. This signal is often too small to be noticed, but several simultaneous changes, coupled with background noise could result in erroneous values.

• Parity bits work well when checking a small number of bits, but when the sequence becomes longer a checksum will help detect transmission errors.

• Basically this is a sum of values.

Problem 18.1 a) Represent the following decimal value thumb wheel input as a Binary Coded Decimal (BCD) and a Hexadecimal Value (without using a calculator).

b) What is the corresponding decimal value of the following BCD

Problem 18.3 Convert the following from binary to decimal, hexadecimal, BCD and octal.

Problem 18.4 Convert the following from decimal to binary, hexadecimal, BCD and octal.

Problem 18.5 Convert the following from hexadecimal to binary, decimal, BCD and octal.

Problem 18.6 Convert the following from BCD to binary, decimal, hexadecimal and octal.

Problem 18.7 Convert the following from octal to binary, decimal, hexadecimal and BCD.

Problem 18.8 Why are binary, octal and hexadecimal used for computer applications?

Problem 18.9 Add/subtract/multiply/divide the following numbers.

Problem 18.10 What are the specific purpose for Gray code and parity?