0
\$\begingroup\$

I'm reading about signed number representation and the book says

-6'd3 // 8-bit negative number stored as 2's complement of 3

Is there a reason as to why a number declared as 6-bit is stored as an 8-bit?

I don't think it is the "sign bits" taking extra bits, as it clearly says 2's complement is used. Even if it is sign bits, then only 1 bit would be required.

\$\endgroup\$
  • 2
    \$\begingroup\$ Looks like a simple typo. \$\endgroup\$ – Dave Tweed Apr 23 at 11:57
  • \$\begingroup\$ That was my next quess. Looking through old similar questions , I see the notation <size><u/s><radix><number> for unsigned/signed. But I haven't heard about it yet in my class. Is it obsolete? If not, does using the notation cause numbers to be stored in the respective r's complement. \$\endgroup\$ – Yasha Apr 23 at 11:59
  • 2
    \$\begingroup\$ "Is it obsolete" No, that is still the correct syntax for a 'sized' negative number. I also think it is a typo. \$\endgroup\$ – Oldfart Apr 23 at 13:08
0
\$\begingroup\$

It's a typo as commented by DaveTweed and Oldfart.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.