The largest signed integer number, base 8, that can be store in a variable of type BYTE

The largest signed integer number, base 8, that can be store in a variable of type BYTE is __________

The smallest signed integer number, base 8, that can be store in a variable of type BYTE is _________


Can someone please explain to me how to get the answer to these questions?
Do you know how large a BYTE is?
8 bits
would it be 127 for largest, and -127 for smallest?
would it be 127 for largest, and -127 for smallest?

No, for two reasons.

1. you expressed the values in decimal notation, but octal was requested in the question.

2. the value for the largest is ok, but the smallest is incorrect.

200 base 8 for smallest.

177 base 8 for largest.

Is this correct now?
Last edited on
Is this correct now?

Yes, I think so.


Let's consider it in binary notation.
Signed binary numbers are stored in twos complement form.
https://www.cs.cornell.edu/~tomf/notes/cps104/twoscomp.html

The highest-order bit represents the sign.
The biggest  signed 8-bit value is 01111111 = +127 decimal
the smallest signed 8-bit value is 10000000 = -128 decimal

to convert binary to octal, split the digits into groups of three.

The biggest  signed 8-bit value is 01 111 111 = 1778
the smallest signed 8-bit value is 10 000 000 = 2008


See base converter
http://coolconversion.com/math/binary-octal-hexa-decimal/


Topic archived. No new replies allowed.