How to represent a decimal number in ternary or base $3$ number system?

$\begingroup$

I need to convert a decimal number into base $3$ number.

$47_{10} ~~\mbox{is}~~ 1202_{3}$.

But how do you represent a negative number in base $3$ notation like $-297$?

please include a example

$\endgroup$ 2

2 Answers

$\begingroup$

Just put a minus sign in front of it. By definition, in base 10 $47 + (-47) = 0$; therefore, $1202_3 + (-1202_3) = 0$ and so $-47_{10}$ is $-1202_3$.

$\endgroup$ $\begingroup$

or you can use 2's compliment and 3's complement which are 2 other ways to represent positive or negative in base 3.

2's compliment base 3 is like 1's compliment in binary and 3's compliment in base 3 is like 2's compliment in binary.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like