Solved

# 4 bytes for integer

Posted on 2014-08-14
232 Views

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
Question by:rgb192

LVL 37

Accepted Solution

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

Maybe this would help? Very simple and has examples.
http://www.is.wayne.edu/OLMT/BINARY/PAGE3.HTM
0

LVL 84

Assisted Solution

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

Author Closing Comment

Thank you for answering and clarifying
0

## Featured Post

The Fluent Interface Design Pattern You can use the Fluent Interface (http://en.wikipedia.org/wiki/Fluent_interface) design pattern to make your PHP code easier to read and maintain.  "Fluent Interface" is an object-oriented design pattern that r…
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.
The viewer will learn how to implement Singleton Design Pattern in Java.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…