Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

4 bytes for integer

Posted on 2014-08-14
4
Medium Priority
?
296 Views
Last Modified: 2014-08-15
4 bytes integer
is integer 4 bytes because 4 sets of 0's and 1's

what is math to turn 1025 into
00000000 00000000 00000100 00000001
0
Comment
Question by:rgb192
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 1336 total points
ID: 40261071
Yes. Each "set" of eight 1s and 0s is a byte. There are 4 bytes to an integer (on your system, it varies).

The 0s and 1s are binary. The farthest right digit is the 1s place then the 2s, 4s, 8s 16s (doubles each time)
So the first 1 is in the 1024 place and the last 1 is in the 1 place 1024+1 = 1025
0
 
LVL 37

Assisted Solution

by:TommySzalapski
TommySzalapski earned 1336 total points
ID: 40261080
Maybe this would help? Very simple and has examples.
http://www.is.wayne.edu/OLMT/BINARY/PAGE3.HTM
0
 
LVL 85

Assisted Solution

by:ozo
ozo earned 664 total points
ID: 40263084
1*2*2*2*2*2*2*2*2*2*2+
0*2*2*2*2*2*2*2*2*2+
0*2*2*2*2*2*2*2*2+
0*2*2*2*2*2*2*2+
0*2*2*2*2*2*2+
0*2*2*2*2*2+
0*2*2*2*2+
0*2*2*2+
0*2*2+
0*2+
1=
1025
0
 
LVL 1

Author Closing Comment

by:rgb192
ID: 40264366
Thank you for answering and clarifying
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction This article discusses the Chain of Responsibility pattern, explaining What it is;Why it is; andHow it is At the end of this article, I hope you will be able to describe the use and benefits of Chain of Responsibility.  Backgrou…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

571 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