What are electronic computers (except ENIAC) based on?
Based on two state devices:
transistors and logic gates.
What are 2 state devices
Devices that can only be in one of two conditions at any time e.g. on/off, yes/no, 1/0
In two-state representation, what do we need to distinguish between electronically?
Electronically, we need to distinguish only between, for example:
Voltage and no voltage
Current and no current
Switch on and off
Electrical pulse and no electrical pulse
What are numeration systems?
All numeration systems are representational — i.e. a form of coding.
What type of notation does the decimal numeral system have?
The decimal numeral system has a positional notation.
How do you convert from decimal to binary
How do you convert from binary to decimal
what does subscript 10 and subscript 2 mean
10 - represents the decimal system
2 - represents the binary system
What are the rules when doing binary addition
0 + 0 = 0
1 + 0 = 1
1 + 1 = 0 and carry the 1 onto the next column
1 + 1 + 1 = Write 1 and carry 1
When you have 1 + 1 and have a carried on 1, you write 1 and carry the other 1.
What are the rules when doing binary subtraction
0 - 0 = 0
1 - 0 = 1
1 -1 = 0
0 - 1 = 1 because you borrow 1 from the next column so the zero essentially becomes a 2.
How can the two states of a collection of two-state devices be used?
The two states of a collection of two-state devices can be used to encode a number in binary representation.
What do computer systems do with two-state devices?
Computer systems use the two states of two-state devices to encode numbers in binary representation — this is exactly what happens in computer systems!
How many bit pattern can a cell of n bits hold
2^n bit pattern
Each bit has 2 possibilities so we do 2x2x2 n number of times which is the same as 2^n
How many different numbers can we store in a byte
256 different numbers, from 0 to 255
What is Binary-Coded Decimal (BCD)?
Binary-Coded Decimal (BCD) is a system where decimal digits are coded directly as 4 bits.
What is Binary-Coded Sexagesimal and how many bits does it use?
Binary-Coded Sexagesimal uses 6 bits to represent values in sexagesimal (base 60), like in time.
What are Gray Codes (reflected binary code)?
Gray Codes, or reflected binary codes, are codes in which successive values differ in only a single digit.
What are the three main representations of signed integers?
The three main representations of signed integers are:
Sign and Magnitude
One’s Complement
Two’s Complement
How do we represent integers from -(2^n - 1) to (2^n -1) in a cell of n+1 bites in sign and magnitude
The first bit represents the sign of the integer - 0 is positive and 1 is negative
The remaining n bits represent the magnitude (using normal binary)
What are the advantages of sign and magnitude
Easy to read
Symmetric about 0
What are the disadvantages of using sign and magnitude
There are 2 representations of 0
Only 255 values are represented in a cell
Arithmetic becomes unnecessarily complicated - there are cases for each combination of signs.
How do we represent integers using 1’s complement
Positive integers are represented by adding a leading 0.
Negative integers are represented by swapping 1’s and 0’s in n. The leading bit still represents the sign
Advantages and disadvantage of 1’s complement
Simplifies arithmetic, but it leaves us with 2 representations of 0.
How does 2’s complement represent integers
Like 1’s complement, we represent -n by swapping 0’s and 1’s in n, and then binary adding 1
E.g. Step 1: Write 6 in binary
6 = 00110
Step 2: Invert all bits (change 0 to 1 and 1 to 0)
00110 → 11001
Step 3: Add 1 using normal binary addition
11001 + 1 = 11010
Final answer:
−6 = 11010