Java default Integer value is int
My code looks like this
How many bits’ address is required for a computer with n bytes of memory?
How many bits of address is required (for the program counter for example) in a byte-addressed computer with 512 Mbyte RAM?
How do you compress ASCII strings into fewer bytes?
I’m working with an embedded device with a unique protocol that sends messages to other devices and I’m making an application that parses the sent packets. Each packet carries 8 bytes. The protocol is defined as where first byte is header and remaining 7 bytes is the data.
How do I tell a user that bps means bits per second or bytes per second?
I’m writing an application that deals with the network and the hard drive. For the network portion, the application measures in bits per second, while the disk portion measures in bytes per second. This becomes an issue as they both are abbreviated b/s
or bps
everywhere I’ve seen. How could I inform the user that one means bits per second, while the other means bytes per second?
How to get from 1 byte to 2 bytes
We have 1 byte
, which is 8 bits
, which is 2^8
. Now 2 bytes
should be 2 * 1 byte
, which is 2 * 2^8 = 2^9
, but actually 2 bytes is 2^16
. What am I missing here? It seems like 2 bytes
isn’t 2 * 1 byte
, it’s more like 1 byte * 1 byte
, but this should give you byte^2
, which doesn’t make sense.
How to get from 1 byte to 2 bytes
We have 1 byte
, which is 8 bits
, which is 2^8
. Now 2 bytes
should be 2 * 1 byte
, which is 2 * 2^8 = 2^9
, but actually 2 bytes is 2^16
. What am I missing here? It seems like 2 bytes
isn’t 2 * 1 byte
, it’s more like 1 byte * 1 byte
, but this should give you byte^2
, which doesn’t make sense.
How to get from 1 byte to 2 bytes
We have 1 byte
, which is 8 bits
, which is 2^8
. Now 2 bytes
should be 2 * 1 byte
, which is 2 * 2^8 = 2^9
, but actually 2 bytes is 2^16
. What am I missing here? It seems like 2 bytes
isn’t 2 * 1 byte
, it’s more like 1 byte * 1 byte
, but this should give you byte^2
, which doesn’t make sense.
How to get from 1 byte to 2 bytes
We have 1 byte
, which is 8 bits
, which is 2^8
. Now 2 bytes
should be 2 * 1 byte
, which is 2 * 2^8 = 2^9
, but actually 2 bytes is 2^16
. What am I missing here? It seems like 2 bytes
isn’t 2 * 1 byte
, it’s more like 1 byte * 1 byte
, but this should give you byte^2
, which doesn’t make sense.
How to get from 1 byte to 2 bytes
We have 1 byte
, which is 8 bits
, which is 2^8
. Now 2 bytes
should be 2 * 1 byte
, which is 2 * 2^8 = 2^9
, but actually 2 bytes is 2^16
. What am I missing here? It seems like 2 bytes
isn’t 2 * 1 byte
, it’s more like 1 byte * 1 byte
, but this should give you byte^2
, which doesn’t make sense.
8 bit and 1 byte, is this a valid question to be asked?
I saw these question in our school’s past paper, and I’m wondering if this is a valid question.