Question

I had file with such content:

00 00 00 00 00

I had changed 1 bit. Changed file:

00 60 00 00 00

My teacher said, that I don't know what means bit. What I did wrong? Clarify this for me, please: file has 5 block (10 digits). Bit is 00? Or bit is 0 — 1 digit of pair. Thank you.

Was it helpful?

Solution

If this is in hexidecimal notation, then you have some terminology confusion.

 00  00  00  00  00
|__|          ^
  \           |
   byte     nibble

A byte is two nibbles, and a nibble is 4 bits.

Decimal   Hex     Binary
   0       0       0000    <- You went from here...
   1       1       0001
   2       2       0010
   3       3       0011
   4       4       0100
   5       5       0101
   6       6       0110    <- ...to here, a change in two bits of one nibble.
   7       7       0111
   8       8       1000
   9       9       1001
  10       a       1010
  11       b       1011
  12       c       1100
  13       d       1101
  14       e       1110
  15       f       1111

OTHER TIPS

That depends on what that notation means, but I'm assuming it's showing 5 bytes in hexadecimal notation.

These are bytes, 8 bit, in binary notation:

00000000
00000001
00000010
...

These are the same bytes in hexadecimal notation:

00
01
02
...

Hexadecimal notation goes from 00 to FF, binary notation for the same values from 00000000 to 11111111. If you changed 00 to 60, you changed 00000000 to 01100000. So you changed 2 bits.

You are viewing the file in a hex editor/viewer. Each digit is a hexadecimal digit consisting of four bits in binary. The fact that you went from 00 to 60 means that you changed two bits in one of the hex digits. If you were viewing in binary mode, you wouldn't see anything other than 0s and 1s.

hex 0  == binary 0000
hex 6  == binary 0110

I would recommend reviewing binary and hexadecimal notation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top