WiredWX Hobby Weather ToolsLog in

 


descriptionSolvedHow many bytes?

more_horiz
Could anyone please explain to me why this uses 32 bytes? Shouldn't 8 bits make 1 byte
and this should make up 16 bytes?

0000000: 0100 4d61 696e 2053 742e 0000 0000 0000 ..Main St.......

0000016: 0000 0000 0000 0000 0000 0000 0000 0000 ................

0000032: 1900 536f 7574 6820 5374 2e00 0000 0000 ..South St......

0000048: 0000 0000 0000 0000 0000 0000 0000 0000 ................

descriptionSolvedRe: How many bytes?

more_horiz
Um not 100% sure, but that looks like hex to me. so each individual number would take up 1 byte?

descriptionSolvedRe: How many bytes?

more_horiz
Yup. The chunk of numbers is hexadecimal view from a hex-editor. But each individual number is called a bit. 8 bits make a byte. But I am confused... The book which I took the sample from wrote that this was a 32 bit string. Could someone please help to clarify my doubts?

descriptionSolvedRe: How many bytes?

more_horiz
Hello,

Each hexadecimal digit represents four binary digits also known as bits. So ignoring the equation of 8 bits = 1 bytes, there are 32 bytes as counted. Shown in bold:

0000000: 0100 4d61 696e 2053 742e 0000 0000 0000 ..Main St.......

0000016: 0000 0000 0000 0000 0000 0000 0000 0000 ................

0000032: 1900 536f 7574 6820 5374 2e00 0000 0000 ..South St......

0000048: 0000 0000 0000 0000 0000 0000 0000 0000 ................

descriptionSolvedRe: How many bytes?

more_horiz
Thanks for your help! Thank You!

descriptionSolvedRe: How many bytes?

more_horiz
Glad I could help! Smile...

descriptionSolvedRe: How many bytes?

more_horiz
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum