Convert Numbers to 12-Bit Binary Using 2's Complement

Click For Summary
SUMMARY

The discussion focuses on converting numbers to 12-bit binary using two's complement representation, specifically for the values 234 and -234. The positive number 234 is represented directly in binary as 000011101010, while the negative number -234 is represented as 111100010110 after applying the two's complement method. The key takeaway is that for positive integers, the binary representation remains unchanged, while negative integers require a conversion process involving complementing the binary digits and adding one. The most significant bit (MSB) indicates the sign of the number in two's complement format.

PREREQUISITES
  • Understanding of binary number representation
  • Knowledge of two's complement method for negative numbers
  • Familiarity with 12-bit binary format
  • Basic arithmetic operations in binary
NEXT STEPS
  • Learn the process of converting decimal numbers to binary
  • Study the two's complement method in detail
  • Explore binary arithmetic operations, including addition and subtraction
  • Investigate how to convert binary numbers to octal and hexadecimal formats
USEFUL FOR

This discussion is beneficial for students studying computer science, particularly those learning about binary number systems and two's complement representation, as well as anyone involved in digital electronics or programming that requires binary manipulation.

fsm
Messages
88
Reaction score
0

Homework Statement


Covert the following numbers to 12-bit binary numbers using two's complement representation.

234
-234

Homework Equations


None I know of.


The Attempt at a Solution


I think I'm making this more complicated than it really is. For 234 I can just convert right to binary or do I have to convert 234 to binary, complement, add 1, complement, and then add 1?

For -234:
000011101010
111100010101
1(adding 1 to LSB)
111100010110

On a side note converting a negative number to octal or hex say -234. You convert it like any other binary number? When converting back how do you know you have a negative number or positive number? By the MSB?
 
Physics news on Phys.org
You did the conversion correctly. The way you can check is to add 234 with -234. The result should be 0 (within the 12 bits).

For positive numbers, you need do nothing. 234 is the same in two's complement, the same in one's complement, the same in unsigned. The conversion method is used to convert positive to negative and negative back to positive.

If the MSB is 1, then yes, that number is negative in two's or one's complement.
 
Thanks!
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
17K
Replies
9
Views
2K
Replies
2
Views
1K