Solved

BINARY CODE

Posted on 2007-11-19
12
220 Views
Last Modified: 2010-04-16
The BYTE  value for 42 in binary is 00101010 - Can someone please explain this logic, as I could not understand clearly.
0
Comment
Question by:JohnSrinivassan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +1
12 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 20316693
128 64 32 16   8    4   2  1
    0   0   1   0   1    0   1  0
            32 +     8   +   2  = 42
     
   
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20316697
JohnSrinivassan,

It can be difficult to understand.  Simply put each number place represents a exponential value of 2.  In the case of a byte it would be 1, 2, 4, 8, 16, 32, 64, and 128.  A value of zero is like a No and a value of 1 is like a Yes for the number.  Starting from the right this means you have 2 + 8 + 32 which equals 42.  Depending on the character type the binary values can have other meanings but this is how the binary you have results in 42.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 84

Expert Comment

by:ozo
ID: 20316753
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 250 total points
ID: 20319097
In binary:

128 64 32 16   8    4   2  1
    0   0   1   0   1    0   1  0
            32 +     8   +   2  = 42

Notice that each digit (bit), as read from right to left, represents a power of 2

In Decimal:

1000   100  10   1
   0        0      4   2  
                    40+2 = 42

each digit ('bit'), as read from right to left, represents a power of 10

AW
0
 

Author Comment

by:JohnSrinivassan
ID: 20323052
128 64 32 16   8    4   2  1
    0   0   1   0   1    0   1  0

What will be the byte value for 50, 44 and 88?  Please explain.  
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20323292
First please explain why you close the question as you did?  I could understand a split but the comment you accepted was not the first or even the second to post the explanation.  It would be nice to know what made you select it over the earlier posts.  (Nothing against AW's good comment)

Then if you do want other numbers explained please let us know what is not clear or understood about the explanation above.  The comments seemed to be general enough to explain this already.

bol
0
 
LVL 84

Expert Comment

by:ozo
ID: 20323361
50 = 32+16+2
44 = 32+8+4
88 = 64+16+8
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20323647
I just noticed the grade was a B too.  Please explain that as well.  If you have questions about grading then let me know.  I'll be happy to help.  If you didn't mean to close this or still had a question about this then let us know.  The experts here can definitely contribute more and help you.  There is no reason you should have to leave without a complete answer worth an A.

bol
0
 

Author Comment

by:JohnSrinivassan
ID: 20330372
b0lsc0tt,
The reason I have given the figures 50, 44 and 88 is to try to understand how the bytes represent them and try to understand 0 is no and 1 is yes from the explanation said before.

"Simply put each number place represents a exponential value of 2.  In the case of a byte it would be 1, 2, 4, 8, 16, 32, 64, and 128.  A value of zero is like a No and a value of 1 is like a Yes for the number.  Starting from the right this means you have 2 + 8 + 32 which equals 42.  Depending on the character type the binary values can have other meanings but this is how the binary you have results in 42"

50 = 32+16+2  
44 = 32+8+4
88 = 64+16+8

The value of 16, 4 & 1 is 0, then how can you take these numbers into account while representing 50, 44 & 88?  This is still a bit of confusion.

What is the logic of 128 and 64 having the value of 0?  Please help me to understand.
Thanks.
0
 
LVL 84

Expert Comment

by:ozo
ID: 20331967
if you have 128 + <anything> the number would already be larger than 50 or 44 or 88
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20332033
Thanks for the response and comment.  Sorry if the way I used Yes/No confused you a bit.  I'll be happy to clarify and help if you'll answer my questions first.  Why did you close the program the way you did accepting only the one comment and the grade you assigned?

bol
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 20332281
50 = 32+16+2    in Binary that would be

    32   16     8    4    2     1     successive powers of 2
     1     1      0     0   1     0   = 110010

44 = 32+8+4

     32   16     8    4    2     1
     1     0       1    1    0     0   = 101100

88 = 64+16+8

     64   32   16   8   4  2   1
       1     0     1   1   0  0   0  = 1011000

an 8 bit value can represent any number between 0 and 255

128   64   32   16    8     4     2      1
   0      0     0     0    0     0     0      0    = 0

   1      1     1     1    1     1     1      1    =  128+64+32+16+8+4+2+1 = 255


AW
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Apps blocked by Java 9 98
Beginner to Unreal Engine 4 5 106
troubleshoot a python script 8 76
batch file or script 4 50
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question