Number of Bits in the Byte


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Number of Bits in the Byte
# 1  
Old 04-09-2008
Number of Bits in the Byte

Char BYTE=0XFE... How can we find the number of Bits in this Byte?


Thanks,
Harika
# 2  
Old 04-09-2008
On a modern machine, all bytes have eight bits.

Do you mean the number of set (one) bits? Convert the number to binary and it should be obvious (if it is not already). Hint: printf(1) (or if you don't have that as a shell command, the corresponding function in awk or perl or C or ...)
# 3  
Old 04-09-2008
Quote:
Originally Posted by harikamamidala
Char BYTE=0XFE... How can we find the number of Bits in this Byte?


Thanks,
Harika
Hi,
I googled a bit for ya Smilie, hope you have bc
Code:
 echo "ibase=16;obase=2; FE" | bc | tr -cd 1 | wc -c

# 4  
Old 04-09-2008
This question looks suspiciously like homework.

Read the rules!
# 5  
Old 04-09-2008
Oopsie, he was lucky, i will be more careful next time Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

Place Bits & Win Bits!!! - 17th Annual Satellite Awards

Ten movies have been nominated as best motion picture by the International Press Academy, presentation of the 2012 Satellite Awards will be held on 16th December at Los Angeles, CA. Place your bits here on one of the below nominated movie of your choice:- Argo ... (0 Replies)
Discussion started by: Yoda
0 Replies

2. Programming

Finding the number of bits a executable was compiled

Hi, Can anyone tell me how to find out how many bits a c executable was compiled in? I am trying to do some investigation of running 32bit programs in 64bit systems. (1 Reply)
Discussion started by: Leion
1 Replies

3. UNIX for Dummies Questions & Answers

32 bits procesaor with 64 bits Solaris

people i have a problem i have a 32 bits sparc processor, and solaris 64 bits processor, i install a oracle data base 64 bits, but my oracle will not run because my processor is from 32 bits this is ok??, i know if i have x86 i cannot install a 64 bits operatin system in a 32 bits processor. ... (0 Replies)
Discussion started by: enkei17
0 Replies

4. What is on Your Mind?

Pick a Number Between 0 and 20 for 1 Million Bits

Here is an easy game! I wrote a number between 0 and 20 (that can include 0 and 20) on a piece of paper. I am staring at it now, imagining the number so you can read my mind ;) Reply once, and only once, with a number from 0 to 20 and the first person to guess it wins 1,000,000 Bits. ... (24 Replies)
Discussion started by: Neo
24 Replies

5. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

6. Shell Programming and Scripting

Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server. For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match. Please... (4 Replies)
Discussion started by: krishmaths
4 Replies

7. AIX

How to convert a partition usin 64 bits kernel to 32 bits kernel?

Hello there: I know that exist a procedure to convert an OS using 32bits kernel to 64 bits kernel. But, exist a procedure to convert an OS using 64bits to 32 bits kernel? Please help me. Regards. (2 Replies)
Discussion started by: GEIER
2 Replies

8. UNIX for Dummies Questions & Answers

Changing 24 bits to 8 bits display

Hello all, I was wondering if anyone can tell me how to change 24 bits depth display to 8 bits depth display for Sun Ultra1, running Solaris 8? THANKS in advance. I think that the command is ffbconfig, but it has nothing about depth. (4 Replies)
Discussion started by: larry
4 Replies
Login or Register to Ask a Question

Featured Tech Videos