saves.the.day
Member
To explain why we divide by 2 you need to get a grasp on two's complement.
Just using a broken down component (4bit instead of 5)
In 1's complement with 3bits of data to store
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
Applying 1's complement (meaning that a 001 which is a 1 in decimal base 10 can be shown as a negative 1 as 110). The table looks like
000 = 0
001 = 1
010 = 2
011 = 3
100 = -3
101 = -2
110 = -1
111 = -0
Recalling how you turn a number into a negative using 1's complement, we'll reverse all the binary digits. E.g. positive 3 (represented by 011) becomes negative 3 represented as 100.
This is why we divide by 2. If we didn't use 1's complement, we'd still have 8 combinations to play with, but ones complement means that we have to make room for 4 negative numbers. In effect, we "lose" 4 combinations.
As you may have noticed by now, 1's complement is inefficient as it makes room for a negative 0. For this reason, we have 2's complement. By adding a 1, we remove the possibility for a negative 0. The table now looks like
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = -3
110 = -2
111 = -1
By adding a one, we remove the possibility for a negative 0. Working through the table we get 111=-1 and 110=-2 etc. One combination remains; 100, which is obviously 4.
Therefore, if we divide by two in this table, we get 8/2 = 4
Now add 1 = 5
The 5th value can then only be
100 = 4
Now using the same logic, you can apply to our other table of 4 bits. Without any ones or twos complement, we get a total of 116 numbers to play with.
1) 0000 = 0
2) 0001 = 1
3) 0010 = 2
4) 0011 = 3
5) 0100 = 4
6) 0101 = 5
7) 0110 = 6
8) 0111 = 7
9) 1000 = 8
10) 1001 = 9
11) 1010 = 10
12) 1011 = 11
13) 1100 = 12
14) 1101 = 13
15) 1110 = 14
16) 1111 = 15
Two's complement will give:
1) 0000 = 0
2) 0001 = 1
3) 0010 = 2
4) 0011 = 3
5) 0100 = 4
6) 0101 = 5
7) 0110 = 6
8) 0111 = 7
9) 1000 = 8
10) 1001 = -7
11) 1010 = -6
12) 1011 = -5
13) 1100 = -4
14) 1101 = -3
15) 1110 = -2
16) 1111 = -1
From the table the highest number is indeed 8
Honestly though, I think this is beyond the scope of the HSC.
Cheers,
Lester Pepingco
Just using a broken down component (4bit instead of 5)
In 1's complement with 3bits of data to store
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
Applying 1's complement (meaning that a 001 which is a 1 in decimal base 10 can be shown as a negative 1 as 110). The table looks like
000 = 0
001 = 1
010 = 2
011 = 3
100 = -3
101 = -2
110 = -1
111 = -0
Recalling how you turn a number into a negative using 1's complement, we'll reverse all the binary digits. E.g. positive 3 (represented by 011) becomes negative 3 represented as 100.
This is why we divide by 2. If we didn't use 1's complement, we'd still have 8 combinations to play with, but ones complement means that we have to make room for 4 negative numbers. In effect, we "lose" 4 combinations.
As you may have noticed by now, 1's complement is inefficient as it makes room for a negative 0. For this reason, we have 2's complement. By adding a 1, we remove the possibility for a negative 0. The table now looks like
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = -3
110 = -2
111 = -1
By adding a one, we remove the possibility for a negative 0. Working through the table we get 111=-1 and 110=-2 etc. One combination remains; 100, which is obviously 4.
Therefore, if we divide by two in this table, we get 8/2 = 4
Now add 1 = 5
The 5th value can then only be
100 = 4
Now using the same logic, you can apply to our other table of 4 bits. Without any ones or twos complement, we get a total of 116 numbers to play with.
1) 0000 = 0
2) 0001 = 1
3) 0010 = 2
4) 0011 = 3
5) 0100 = 4
6) 0101 = 5
7) 0110 = 6
8) 0111 = 7
9) 1000 = 8
10) 1001 = 9
11) 1010 = 10
12) 1011 = 11
13) 1100 = 12
14) 1101 = 13
15) 1110 = 14
16) 1111 = 15
Two's complement will give:
1) 0000 = 0
2) 0001 = 1
3) 0010 = 2
4) 0011 = 3
5) 0100 = 4
6) 0101 = 5
7) 0110 = 6
8) 0111 = 7
9) 1000 = 8
10) 1001 = -7
11) 1010 = -6
12) 1011 = -5
13) 1100 = -4
14) 1101 = -3
15) 1110 = -2
16) 1111 = -1
From the table the highest number is indeed 8
Honestly though, I think this is beyond the scope of the HSC.
Cheers,
Lester Pepingco
Last edited: