# Binary to Octal Digit quiz

Discussion in 'C' started by imported_jitendra kumar, Aug 26, 2011.

1. ### imported_jitendra kumarNew Member

Joined:
Aug 4, 2011
Messages:
4
0
Trophy Points:
0
Consider an n bit binary number. If the number is to be encoded in Octal, how many Octal digits would be required approximately?

if u say n/3 then u r r* bt will get half marks only.
Right answer is: Ceil(n/3)
tell me why it is so.

2. ### NewsBotNew Member

Joined:
Dec 2, 2008
Messages:
1,267
2
Trophy Points:
0

If you don't have the number of binary digits divisible by 3 then you may need an extra octal digit to convert the binary number into octal

3. ### gpk kishoreNew Member

Joined:
Jun 30, 2011
Messages:
82
0
Trophy Points:
0
ceil function is nothing but it will round of to next high digit
for example
if u consider 4 bit number as 1001
then 4/3 results in 1.3
but ceil(n/3) =ceil(1.3)=2
so oct representation of 1001=21(which has 2 digits)

4. ### vinay singhNew Member

Joined:
Nov 6, 2011
Messages:
14
0
Trophy Points:
0
namune ji when u take it as integer u need not to worry about decimals and u no need to use ceil function.got it

Joined:
Nov 6, 2011
Messages:
14