COMP503 Bitwise Logical Operations
Answered
Carry out the operations, assume that the numbers are unsigned and unlimited bits to represent: Base 2: 01101111 + 11001101 Base 16: DBEAF1CA + F1CAF1CA Question 3: (Bitwise Logical Operations Assume that numbers are represented as signed, 8-bit 2’s complement representation. Carry out the following operations : 0011 1110 | 0111 0001 (note: OR operation) 1010 1011 & 0100 1101 (note: AND operation) 1010 1010 ^ 1101 1100 (note: Exclusive OR operation) 0011 0101 << 4 (note: Shift left arithmetic operation) Question 4: 2’s Complement Conversion Assume that numbers are represented as signed, 8-bit 2’s complement representation. If the last two digits of your AUT ID is B, if your ID is 123456 then B = 56. Work out the following question (replace B with your last 2 digits of your ID): Convert –5610 to 8-bit 2’s complement Binary; give the answer in 8 bits binary number. Question 5: ASCII Characters The Appendix gives a table for 7-bit ASCII. Using this table, we can work out the hexadecimal value corresponding to the encoding of this ASCII string “ABBA” (assume each 7-bit code coccupies the space of an 8-bit byte with the MSB=0) as 4142424116 Find the hexadecimal and Binary values corresponding to your full name (note that there are spaces in the string); answer the following: Your full name in Hexadecimal (base 16) How many bits are used (do not count the end of string byte)