The Student Room Group

how do i do this stupid question?

:show that the ASCII code 32 is represented by the 8-bit binary code 00100000.

How on earth am I meant to do this? :L thanks :smile:
Original post by polaritymolecule
:show that the ASCII code 32 is represented by the 8-bit binary code 00100000.

How on earth am I meant to do this? :L thanks :smile:


are you familiar with expressing numbers in our decimal base in binary?

as in, you know the number 3 in binary is written as 00000011?
(edited 11 years ago)
Original post by boner in jeans
are you familiar with expressing numbers in our decimal base in binary?

as in, you know the number 3 in binary is written as 00000011?

nope i am not familiar with that :redface:
Reply 3
Original post by polaritymolecule
:show that the ASCII code 32 is represented by the 8-bit binary code 00100000.

How on earth am I meant to do this? :L thanks :smile:


I am guessing you don't know how binary works?

The first digit on the right of your code represents 0 or 1 in decimal. So a code like this - 0001 converts to 1 in decimal.

The second digit from the right represents 0 or 2 in decimal. So a code like this - 0010 converts to 2 in decimal.

A code like this 0011 converts to 3 in decimal. Hope you are following me here.

Each successive digit read from the right represents a doubled amount when converted to decimal so - 0100 is 4, 1000 is 8, 1100 is 12, 1111 is 15.

Now make yourself a table up a bit like this -

128 64 32 16 8 4 2 1

Put in your code underneath and hopefully you should of reached your answer.
Original post by polaritymolecule
nope i am not familiar with that :redface:


oh well not to worry, it is trés facile! you can learn it in 5 minutes :wink:

well you know how we normally write numbers? we use the decimal system, that is every number is expressed as a power of 10. take the number 356 => 3 is in the 'hundreds' column (10^2), 5 is in the tens column (10^1) and 6 in the units column (10^0) => you can see why it's called the decimal system, each number is in a 'column' that is a power of 10

the binary system uses powers of 2 instead - conventionally you write 8 0s and then put in 1s to express the number you want, but obviously you could have infinite 0s

now you read it from the left and it's like the decimal system, but with base 2. So now consider 8 zeros (00000000) - now, each zero represents powers of 2. So, the zero on the most right represents 2^0 (1), first from the right is 2^1 (2), second from the right is 2^2 (4) and so on

now, the number you want to express is a sum of the numbers you put a 1 in to represent your numbers. So if you want to write 1, you write 00000001, if you want to write 2 you write 00000010, 3 is 00000011, 4 is 00000100, 5 is 00000101 and so on.

get it?

Quick Reply

Latest