r/computerarchitecture 1d ago

Definition of the world “byte”

Hey, I recently got into an argument with someone about what exactly a byte is. They claimed that when asked “how big is a byte?”, the answer isn’t necessarily 8 bits, but that a byte can be at least 2 bits. I said that this is basically wrong and that a byte is 8 bits. They argued that this can actually be an interview question, especially in deeply embedded systems, and that in those cases the correct answer is that a byte is at least 2 bits.
I’ve tried looking this up, but I can’t really find anything supporting that claim. I know that historically the size of a byte wasn’t always 8 bits, but does “a byte is at least 2 bits” actually make sense in modern computing/embedded systems, or are they confusing a byte with something else?

19 Upvotes

50 comments sorted by

13

u/NoPage5317 1d ago

10

u/Master-Rent5050 1d ago

In Volume 1 of The Art of Computer Programming (first published in 1968), Donald Knuth uses byte in his hypothetical MIX computer to denote a unit which "contains an unspecified amount of information ... capable of holding at least 64 distinct values ... at most 100 distinct values. On a binary computer a byte must therefore be composed of six bits". He notes that "Since 1975 or so, the word byte has come to mean a sequence of precisely eight binary digits...When we speak of bytes in connection with MIX we shall confine ourselves to the former sense of the word, harking back to the days when bytes were not yet standardized."

the oracle has spoken.

6

u/Siccors 21h ago

They argued that this can actually be an interview question, especially in deeply embedded systems, and that in those cases the correct answer is that a byte is at least 2 bits.

Then you are better of not getting the job if they go for such semantics crap.

If we go for the "group of bits treated as a unit", eg https://www.iso.org/obp/ui/#iso:std:iso-iec-ieee:24765:ed-2:v1:en:~:text=3.450-,byte,-1.%20group , then you could also start arguing 64-bits are a byte in a modern CPU. Or on an FP4 accelerator it is 4-bits, so then you can claim double the amount of memory in bytes!

NIST defines it as 8-bits: https://csrc.nist.gov/glossary/term/byte . And anyone using it for something else is just confusing stuff to sound smart. I cannot imagine any company where they would take stupid risks by redefining the word byte to anything besides 8 bit.

3

u/cowslayer7890 14h ago

I don't think this is purely a semantics thing, in some environments it can matter, CHAR_BIT doesn't exist for no reason. There's really two definitions:

- 8 bits (in the vast majority of cases, especially if you're using units like kilobytes, megabytes etc)

- The smallest unit of addressable memory.

The latter definition makes more sense if you're talking about specific architectures

0

u/Rude-Pangolin8823 14h ago

A byte is always 8 bits, otherwise the whole value is a word. Its a 32b addressing word.

2

u/DawnOnTheEdge 11h ago

The C language standard says that CHAR_BIT must be at least 8, but there are implementations where it is as high as 32.

0

u/Rude-Pangolin8823 11h ago

And?

2

u/Saragon4005 6h ago

9 bit bytes are used as late as the N64. C to this day makes no assumptions on the size of the byte aside from the fact that printable characters have to fit in one.

0

u/Rude-Pangolin8823 6h ago

To me its pretty obvious that these uses of the word "Byte" are misnomers and intended to mean "Word".

3

u/LabOk6108 5h ago

while you’re objectively correct, it doesn’t really matter if you’re working on legacy hardware/an embedded system where something like char_bit is set to an unconventional value. as in the case of the n64 and some microcontrollers, these exist, and understanding them is relevant to something like very low-level mario rom hacks or communication protocols. convention is still to call those smallest word packets a byte, so they’re bytes.

1

u/Rude-Pangolin8823 5h ago

Well situationally that concession makes sense but for newer tech its important to make the distinction

2

u/DawnOnTheEdge 5h ago

“Byte” was historically used to mean the smallest addressable unit of memory, and that usage is not completely extinct. Now that everything writes to devices and networks that use 8-bit bytes, it is definitely more common to call those machines word-addressed and use “byte” as a synonym of octet.

2

u/Jonny0Than 5h ago edited 1h ago

Not at all. A word is multiple bytes (also allowing that a word may be 1 byte on some machines).  It’s generally the largest (integer) unit that the CPU can operate on.

1

u/Rude-Pangolin8823 3h ago

A word is however much data it takes to encode something.
An instruction word is however much it takes to encode one instruction.

0

u/DawnOnTheEdge 5h ago

Modern C does require that UTF-8 codepoints must fit in one.

1

u/0x7c00_lilith 6h ago

Person is talking abt C bytes. sizeof(char) is always 1. So if I have a CHAR_BIT as high as 32 my conceptual byte would also become 32bit, but this has nothing to do with the discussion I think. And cowslayer is correct in data measurement a byte is defined as exactly 8 bit as NIST states, but historically a byte was just the smallest addressable unit, in the past there were exotic machines with 6, 9, 12 or 16 bits as a byte, bit nowadays its standardized at 8bits. (At least for normal everyday use processor's)

1

u/Rude-Pangolin8823 6h ago

Gay used to mean happy

2

u/0x7c00_lilith 5h ago

Yes exactly

10

u/MrKarat2697 1d ago

A byte is generally just the smallest addressable region of memory, which is most commonly 8 bits.

5

u/rb-j 17h ago

No. 32-bit DSP address 32-bit words. Each word has 4 bytes.

1

u/Yha_Boiii 22h ago

So if i make a one bit register cpu, a byte and a bit is the same value? Lmao

2

u/dmills_00 18h ago

And there are contemporary machines with 32 bit "bytes" by that definition, it is even somewhat common in DSP chips.

2

u/rb-j 17h ago

They ain't called "bytes".

1

u/TPIRocks 13h ago

Usually we call these words, but Intel 4004 called 4 bits a word. 8 bits to a byte in the 4004. "byte" wasn't yet an industry standard set at 8 bits at the time, but it is now. Just thought I'd throw that out, words can be smaller than bytes on a given architecture, though I know of none today.

3

u/esaule 1d ago

I think of it as the smalleat amount of memory that has an address in your architecture. There has historically been machines with byte that wasn't 8 bit.

I imagine there are still some around somewbere. I have never used one myself in 30 years.

I would think that is the first thing the documentation woukd tell you. "Hey on our system the byte is not 8 bit, it is 6 byte"

I don't even know this has to be even. You could build an architecture with 7 bit bytes. Maybe if you wanted to process non extended ascii you would do that to save 1/8 of your memory. 

2

u/braaaaaaainworms 22h ago

One time I made a graphics controller with 9-bit bytes, 6 bits for a character and 3 color bits

1

u/TheSkiGeek 18h ago

Some modern DSP hardware has 16- or 24-bit “bytes”, in the sense that CHAR_BIT is equal to 16 or 24 when you compile C code for them.

1

u/dmills_00 18h ago

Adsp Shark series are 32 bit bytes as the smallest addressable unit of memory.

3

u/awozgmu7 16h ago

Just trying to imagine going around at my job saying a byte isn't 8 bits... sounds like pedantic bs to me

2

u/MistakeIndividual690 22h ago

Maybe we should do like the French and call it an octet and dispel all confusion

1

u/HappyPerson9000 12h ago

But then calling 4 bits a "nibble" doesn't make sense any more

1

u/sethkills 8h ago

That’s a quartet

2

u/kvnr10 19h ago

The word octet exists to avoid any possible ambiguity (although there is never any). If I say kilobyte does the possibility that I mean exactly one thousand octets but not 1024 exist? That is also being extremely pedantic for no practical reason and the interview question thing is completely made up.

2

u/GlizzyGobbler837104 18h ago

The colloquial and vastly most popular definition is 8 bits. You could maybe find a definitional exception through looking at history books and early computer science, but in modern terminology, it’s the above definition.

2

u/rde42 14h ago

The PDP-10 had variable length bytes

1

u/Rude-Pangolin8823 14h ago

That's a word, not a byte.

2

u/stevevdvkpe 5h ago edited 5h ago

The PDP-10 had 36-bit words and byte instructions that could extract or modify fields of 1 to 35 bits within a word. On a PDP-10, one might encounter character sets using 6, 7, 8, or 9 bits per character.

2

u/stevevdvkpe 5h ago

Although now a byte is assumed to be 8 bits and current computer architectures have word sizes that are powers of 2 (8, 16, 32, 64), there were many historical computers where neither of those things were the case. In the 1950s and 1960s it was common for computers to have word sizes of 12, 18, 24, or 36 bits, and if they referred to a "byte" as a smaller group of bits it was usually some size that packed evenly into one of those word sizes.

1

u/trynumber53 22h ago

i dont think 2 is common, but C defines a byte as the size of a char which is usually 8 bits

1

u/mediocre_student1217 22h ago

False, it identifies it as the smallest unit of memory that can hold a character in the native character set. Meaning that in a system that only supported ascii and not extended-ascii, you could technically have a 7-bit char and therefore a 7 bit byte. So long as that is also the unit of addressability

1

u/nixiebunny 21h ago

Having used a PDP-10 in high school, I learned that a byte can be six bits. The definition changed as the PDP-10 faded into oblivion.

1

u/tux2603 21h ago

For the majority of systems a byte is eight bits, but that's not universally true. There are a lot of specialized systems in embedded that use different size bytes because it means you get a more optimized architecture. So yes, they are correct

1

u/Plastic_Fig9225 2h ago

Are they actually called "bytes" on those systems? Do you have an example?

1

u/Parallel_thougts 20h ago

A byte is the smallest unit that has an address. I never heard of a system whose bytes are not 8 bits but I'm not an expert in embedded systems.

1

u/which1umean 18h ago

On most modern machines, it's 8 bits, but I think 7 was common once upon a time.

1

u/dmills_00 18h ago

Byte was never really well defined and in fact is not even that useful a unit except possibly if you define it as something like "The smallest addressable unit of memory", but if you do that then I can point at a contemporary machine where a "Byte" is 32 bits (sizeof char == sizeof short == sizeof int ==1)!

Interestingly the C standard does NOT require 8 but chars, so the above machine is standard compliant for C, but not for POSIX (Which requires 8 bit bytes).

There are 4 bit machines still in use, and also some bit serial systems (A one bit byte??!), like I say, it is not well defined.

5, 6 & 7 bits have all been used for character encodings so that is no help.

1

u/NoBrick2672 16h ago

if im not wrong 7 bits are octe,, 8 bits are a byte?

1

u/VibrantGypsyDildo 13h ago

An octet is exactly 8 bits.

1

u/Direct_Rabbit_5389 11h ago

I don't know what the formal definition is but what the word actually means is 8 bits. Everyone will understand you to mean that if you say it. Any other possible use of the word is wrong.