# 9.4.2 Interrelationship between hardware and software Flashcards

Explain how to convert a binary number to a decimal

Binary numbers consist of either 1 or 0 in place values that are powers of 2.

Determine the place value of each 1 and sum them.

Explain how to convert a decimal number to binary

Moving from left to right, “fill up” the binary values as much as possible for each value.

How many distinct values can be stored in a binary number?

2 to the power of n, where n is the length of the binary number.

For example, a byte (8 bits) can store 256 values because 2^8 = 256.

How does the hexadecimal number system work?

Hexadecimal is base 16. The hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, A, B, C, D, E, F.

Because 16 is a power of 2, the hexadecimal number system is used as a shorthand way of writing binary numbers.

Explain how to convert a hexadecimal number to binary.

Each group of 4 bits corresponds to a single hexadecimal digit. Just join them together!

Explain how to convert hexadecimal numbers to decimal

Multiply each digit value by the place value of the power of 16.

Explain how negative integers are represented using sign-modulus form.

The leading bit indicates whether or not the integer is negative (0 for positive, 1 for negative).

Explain how negative integers are represented using 1s complement form.

Invert all bits of the positive number

Explain how negative integers are represented using 2s complement form.

The leading bit takes on a negative value

What is the process for adding 2 binary numbers?

Use vertical addition, carrying bits as needed

What is the process for subtracting 2 binary numbers?

*Add* the negative.

What is the process for multiplying 2 binary numbers?

Use long multiplication (“shift and add”)

What is the process of dividing 2 binary numbers

Use the process of long division: repeated steps of divide, multiply through, subtract, bring down.

How are characters represented in ASCII

Each character is represented as a 7-bit binary number, giving a total of 128 characters. Most of these are printable characters found on a standard keyboard, but some are “control characters”

What is the ASCII code for the capital letter ‘A’?

65 in decimal

100 0001 in binary