HW Flashcards
Cardinal and ordinal numbers
Natural numbers are used for counting and
ordering. More formally we use the terms cardinal and ordinal.
Rational numbers
- We use Q to denote mathematical notation for rational
numbers. Rational numbers are any number that can be represented by a fraction
where the numerator and denominator are integers a and b
𝑎
𝑏
.Rational numbers
can be positive and negative and include integer values. A recurring number such
as 0.3333… is a rational number because it can be represented by a fraction, in this
case
1
3
Real numbers
The set of real numbers R includes both rational and irrational
numbers. Real numbers are uses for the measurement of continuous values. Eg
measuring length or weight.
Denary
is base-10 and is the number system we are most familiar
with. We have the columns of units, tens, hundreds, thousands and so on. Base-10
means that we have 10 possible values (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) in each column.
Binary
is base-2 and has 2 values, 0 and 1. It requires a greater number of digits in
binary to represent a number than denary. This is how data and instructions are
stored in a computer
Hexadecimal
Hexadecimal is used a lot in computing because it much easier to read than binary.
There are far fewer characters than binary. So hexadecimal is often used in place
of binary as a shorthand to save space. For instance, the hexadecimal number
7BA3D456 (8 digits) is 01111011101000111101010001010110 (32 digits) in binary
which is hard to read.
Hexadecimal to binary conversion
1) Find the corresponding 4-bit binary number for the hex digits
2) Concatenate the binary values to give the final binary value
Binary to hexadecimal conversion
1) Split the binary number into groups of 4 bits: 11102 10102. If the number
of bits is not divisible by 4 prepend the binary number with 1,2 or 3 zeros
to make it divisible by 4.
2) Find the corresponding Hex value for each of the 4-bit groups
Bits and Bytes
A bit is the fundamental unit of binary numbers. A bit is a binary digit that can be
either 0 or 1. Bit is short for binary digit
A byte contains 8 bits, as a power of 23
.
The number of different values tha
Steps for converting a negative Two’s complement number to denary
1) Flip bits
2) Add 1
3) Convert from binary to denary
4) Add the minus sign (it is really easy to forget)
Fixed Point Representation
Fixed point binary is one method used to represent fractions in binary. An
imaginary point is used to represent the fractional part of a number. The table
below shows the corresponding decimal and binary representation of some
fractions. We need to introduce an imaginary point to the binary number to
separate the whole and fractional part of the number.
Underflow
Number is too small to be represented in a number of bits. For
instance you cannot represent the number 0.00390625 using fixed point 8 bits.
The number would be represented as 0. Can occur when you divide a small
number be a very large number.