0
$\begingroup$

I know that an ASCII character needs 1 byte of memory for storage, but if a computer uses a 64-bit word addressable memory does it mean that the character actually takes 8 bytes even when only 1 byte was needed?

Does being a 64-Bit word addressable memory mean the same as being a 64-Bit machine?

$\endgroup$
2
  • 1
    $\begingroup$ Welcome to CS.SE! The usual rule is to ask only one question per post. If you have two questions, you can ask them by making two separate posts. $\endgroup$
    – D.W.
    Aug 11, 2020 at 19:21
  • $\begingroup$ I will keep that in mind. Thanks! $\endgroup$ Aug 14, 2020 at 16:23

1 Answer 1

1
$\begingroup$

It depends. A program can store 1 ASCII character in each 64-bit word, or 8 ASCII characters in each 64-bit word. It's up to each individual program to decide how it wants to store and format its data in memory. The latter would probably be more typical.

$\endgroup$
1
  • $\begingroup$ Or you could be like old-school Haskell and say that a string is a cons list of pointers to character objects, because who needs memory? $\endgroup$ Aug 12, 2020 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.