News for hackers. Stuff that matters.
Re:C++ proposal: There are 8 bits in a byte by gerdesj on Thursday October 17, 2024 @09:10PM (#41875486)
"1. bytes are 8 bits"

How big is a bit?

Re:C++ proposal: There are 8 bits in a byte by thamer on Thursday October 17, 2024 @10:06PM (#41875768)
This doesn't feel like a serious question, but in case this is still a mystery to you… the name bit is a portmanteau of binary digit, and as indicated by the word "binary", there are only two possible digits that can be used as values for a bit: 0 and 1.
Re:C++ proposal: There are 8 bits in a byte by seoulbigchris on Friday October 18, 2024 @04:16AM (#41877360)
So trinary and quaternary digits are trits and quits?
Re:C++ proposal: There are 8 bits in a byte by eqvinox on Friday October 18, 2024 @06:07AM (#41877866)
Yes, trit is commonly used for ternary logic. "quit" I have never heard in such a context.
Re:C++ proposal: There are 8 bits in a byte by euroderf on Sunday October 20, 2024 @01:04PM (#41896800)
So shouldn't a two-state datum be a twit ?
Re:C++ proposal: There are 8 bits in a byte by basementcat on Thursday October 17, 2024 @11:41PM (#41876149)
A bit is a measure of information theoretical entropy. Specifically, one bit has been defined as the uncertainty of the outcome of a single fair coin flip. A single less than fair coin would have less than one bit of entropy; a coin that always lands heads up has zero bits, n fair coins have n bits of entropy and so on.

https://en.m.wikipedia.org/wiki/Information_theory

https://en.m.wikipedia.org/wiki/Entropy_(information_theory)

Re:C++ proposal: There are 8 bits in a byte by fourier54 on Friday October 18, 2024 @12:04AM (#41876245)
That is a bit in information theory. It has nothing to do with the computer/digital engineering term being discussed here.
Re:C++ proposal: There are 8 bits in a byte by sirsinsalot on Friday October 18, 2024 @01:00AM (#41876484)
This comment I feel sure would repulse Shannon in the deepest way. A (digital, stored) bit, abstractly seeks to encode and make useful through computation the properties of information theory.

Your comment must be sarcasm or satire, surely.

Re:C++ proposal: There are 8 bits in a byte by fourier54 on Friday October 18, 2024 @11:51AM (#41880541)
I do not know or care what would Mr. Shannon think. What I do know is that the base you chose for the logarithm on the entropy equation has nothing to do with the amount of bits you assign to a word on a digital architecture :)
Re:C++ proposal: There are 8 bits in a byte by dullcrisp on Friday October 18, 2024 @12:01AM (#41876238)
At least 2 or 3
Re:C++ proposal: There are 8 bits in a byte by CoastalCoder on Thursday October 17, 2024 @09:55PM (#41875701)
> How big is a bit?

A quarter nybble.

Re:C++ proposal: There are 8 bits in a byte by nonameiguess on Thursday October 17, 2024 @11:14PM (#41876060)
How philosophical do you want to get? Technically, voltage is a continuous signal, but we sample only at clock cycle intervals, and if the sample at some cycle is below a threshold, we call that 0. Above, we call it 1. Our ability to measure whether a signal is above or below a threshold is uncertain, though, so for values where the actual difference is less than our ability to measure, we have to conclude that a bit can actually take three values: 0, 1, and we can't tell but we have no choice but to pick one.

The latter value is clearly less common than 0 and 1, but how much less? I don't know, but we have to conclude that the true size of a bit is probably something more like 1.00000000000000001 bits rather than 1 bit.

Re:C++ proposal: There are 8 bits in a byte by poincaredisk on Thursday October 17, 2024 @09:41PM (#41875621)
A bit is either a 0 or 1. A byte is the smallest addressable piece of memory in your architecture.
Re:C++ proposal: There are 8 bits in a byte by elromulous on Thursday October 17, 2024 @09:56PM (#41875706)
Technically the smallest addressable piece of memory is a word.
Re:C++ proposal: There are 8 bits in a byte by Maxatar on Thursday October 17, 2024 @11:13PM (#41876056)
I don't think the term word has any consistent meaning. Certainly x86 doesn't use the term word to mean smallest addressable unit of memory. The x86 documentation defines a word as 16 bits, but x86 is byte addressable.

ARM is similar, ARM processors define a word as 32-bits, even on 64-bit ARM processors, but they are also byte addressable.

As best as I can tell, it seems like a word is whatever the size of the arithmetic or general purpose register is at the time that the processor was introduced, and even if later a new processor is introduced with larger registers, for backwards compatibility the size of a word remains the same.

Re:C++ proposal: There are 8 bits in a byte by asveikau on Thursday October 17, 2024 @11:05PM (#41876026)
Depends on your definition of addressable.

Lots of CISC architectures allow memory accesses in various units even if they call general-purpose-register-sized quantities "word".

Iirc the C standard specifies that all memory can be accessed via char*.

Re:C++ proposal: There are 8 bits in a byte by mort96 on Friday October 18, 2024 @02:50AM (#41876953)
Every ISA I've ever used has used the term "word" to describe a 16- or 32-bit quantity, while having instructions to load and store individual bytes (8 bit quantities). I'm pretty sure you're straight up wrong here.
Re:C++ proposal: There are 8 bits in a byte by bregma on Friday October 18, 2024 @06:07AM (#41877868)
The difference between address A and address A+1 is one byte. By definition.

Some hardware may raise an exception if you attempt to retrieve a value at an address that is not a (greater than 1) multiple of a byte, but that has no bearing on the definition of a byte.

Re:C++ proposal: There are 8 bits in a byte by throw16180339 on Friday October 18, 2024 @09:03PM (#41884816)
That's only true on a word-addressed machine; most CPUs are byte-addressed.
Re:C++ proposal: There are 8 bits in a byte by Nevermark on Thursday October 17, 2024 @10:00PM (#41875737)
Which … if your heap always returns N bit aligned values, for some N … is there a name for that? The smallest heap addressable segment?
Re:C++ proposal: There are 8 bits in a byte by zombot on Friday October 18, 2024 @04:36AM (#41877432)
If your detector is sensitive enough, it could be just a single electron that's either present or absent.
Re:C++ proposal: There are 8 bits in a byte by amelius on Friday October 18, 2024 @05:35AM (#41877720)
Depends on your physical media.