Question

In: Computer Science

Convert from twos compliment in 7 bits to base ten (decimal) a. 1100010 b. 0101010

Convert from twos compliment in 7 bits to base ten (decimal)

a. 1100010

b. 0101010

Solutions

Expert Solution

Please go through the solution given below.If find any difficulty,feel free to ask in comment section.Please do upvote the answer.Thank you.

Converting 2's complement binary to decimal form procedure

  • Check the left most digit of the number which represent the sign
  • If it is 0, then the number is positive and if it is 1,then the number is negative
  • If the number is positive,simply convert it into decimal.This is done by sum up the product of each bit and their weight(20,21,22,....)
  • If the number is negative make it positive by inverting the bits,all 0's to 1's and all 1's to 0's and add 1 to it.
  • Then convert the result obtained to decimal.
  • The negative of this decimal number is the decimal form of the original binary number

a)1100010

  • The left most digit of the number is 1.So the number is negative
  • Invert all bits and add 1
  • 0011101+1 =0011110
  • Convert 0011110 to decimal
  • 0011110 = 1x24+1x23+1x22​​​​​+1x21+0x20 = 16+8+4+2+0= 30
  • So the decimal equivalent of 1100010 is -30

b)0101010

  • The left most digit of the number is 0.So the number is positive
  • Convert 0101010 to decimal
  • 0101010 =1x25+ 0x24+1x23+0x22​​​​​+1x21+0x20 = 32+0+8+0+2=42
  • So the decimal equivalent of 0101010 is 42

Related Solutions

i need to convert decimal to twos complement binary and then add the binary digits but...
i need to convert decimal to twos complement binary and then add the binary digits but I am unable to do it. I am only allowed to use string, can anyone help me out please. i need the code urgently. #include #include #include #include using namespace std; string reverse(string s) { string x = ""; for (long i = s.length() - 1; i >= 0; i--) { x += s[i]; } return x; } string twosComplementStringsAddition(string A, string B) {...
convert the binary number(base 2) To Octal (base 8) to decimal (base 10) a. 101 b....
convert the binary number(base 2) To Octal (base 8) to decimal (base 10) a. 101 b. 1001 c. 101010 d.1101101 convert the number to the other base a. 253 base 10 to base 8 b. 98 base 10 to base 3 C. 1340 base 10 to base 16 D. AB Base 16 to base 8 E. 111010 base 2 to base 16 F. 1010101 base 2 to base 6 g. 69 base 10 to base 2 h . 1023 base...
Write a c++ program to convert any decimal number to either binary base  or Hex base...
Write a c++ program to convert any decimal number to either binary base  or Hex base number system. Test your program with the followings: Convert 15 from decimal to binary.  Convert 255 from decimal to binary. Convert BAC4 from hexadecimal to binary Convert DEED from hexadecimal to binary.  Convert 311 from decimal to hexadecimal. Convert your age to hexadecimal.
10. Convert 101 1010 (seven bits) into a signed decimal (show work) 15. Give the value...
10. Convert 101 1010 (seven bits) into a signed decimal (show work) 15. Give the value of 011 1101 and C=0 with ROL (seven bits, show work) 16. Give the signed decimal value of 93A (12 bits, show work) 18. Give the binary equivalent of the decimal number of 13.57 (assume fixed point, no more than 6 bits left and right of the decimal point)
How to convert 12345 from base 10 to base 2?
How to convert 12345 from base 10 to base 2?
Convert 101 from base-2 number system to base-10 number system Convert 101 from base-2 number system...
Convert 101 from base-2 number system to base-10 number system Convert 101 from base-2 number system to base-16 number system Convert 100 from base-10 number system to base-2 number system Convert 100 from base-10 number system to base-16 number system Convert ef from base-16 number system to base-2 number system Convert ef from base-16 number system to base-10 number system
Convert the following decimal number to eight (8) binary bits: 21, 200, 105, 144, 183, 199,...
Convert the following decimal number to eight (8) binary bits: 21, 200, 105, 144, 183, 199, 88, 100, 19, 204
Convert these numbers from Decimal to Binary 111: 66: 252 11 20 Convert these numbers from...
Convert these numbers from Decimal to Binary 111: 66: 252 11 20 Convert these numbers from Binary to Decimal 00110110 11111000 00000111 10101010 What is the Default Subnet mask of Class A IPV4 What is the Default Subnet mask of Class B IPV4 What is the Default Subnet mask of Class C IPV4 What is the CIDR notation or / short handwriting of Subnet masks: Class A: /?. Explain the reason Class B: /? Explain the reason Class C: /?...
Convert 11001001100101101011010011010111 from IEEE 754 to decimal show work
Convert 11001001100101101011010011010111 from IEEE 754 to decimal show work
Convert from binary to decimal to hexadecimal (PLEASE SHOW ALL WORK) a. 1010 1011 - decimal:...
Convert from binary to decimal to hexadecimal (PLEASE SHOW ALL WORK) a. 1010 1011 - decimal: - hexadecimal b. 0011 0001 - decimal: - hexadecimal: c. 1110 0111 - decimal: - hexadecimal: d. 1111 1111 - decimal: - hexadecimal:
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT