lint all files
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
1)
|
||||
**a) Choose a number between 51 and 70. This will be number A. Choose another number between 80 and 120. This will be number B. Using 2’s complement 8-bit binary arithmetic, calculate number A – number B giving your answer in binary and decimal. (5 marks)**
|
||||
|
||||
Number A - 64 - 0100 0000
|
||||
@@ -9,7 +8,7 @@ Number B - 96 - 0110 0000
|
||||
| Num A | 0100 0000 |
|
||||
| Num B | 0110 0000 |
|
||||
| Flip B | 1001 1111 |
|
||||
| Add 1 | 1010 0000 |
|
||||
| Add 1 | 1010 0000 |
|
||||
|||
|
||||
| Num A | 0100 0000 |
|
||||
| Num B | 1010 0000 |
|
||||
@@ -99,4 +98,4 @@ NumberF - 223
|
||||
| OR (Hexadecimal) | 0xFF |
|
||||
| OR (Octal) | 0377 |
|
||||
|
||||
Here, I have picked two numbers, the first of which is converted to hexadecimal, and the second converted to octal using a division conversion method on the decimal value. Then I have done a bitwise operation for OR on the two binary values to get a binary value, and then converted to decimal, hexadecimal and octal - in this case it is the maximum value for each using 8 bit binary.
|
||||
Here, I have picked two numbers, the first of which is converted to hexadecimal, and the second converted to octal using a division conversion method on the decimal value. Then I have done a bitwise operation for OR on the two binary values to get a binary value, and then converted to decimal, hexadecimal and octal - in this case it is the maximum value for each using 8 bit binary.
|
||||
|
Reference in New Issue
Block a user