Talk:Bitwise IO: Difference between revisions

Number vs. numeral system vs. memory representation
(Number vs. numeral system vs. memory representation)
Line 13:
 
Ok, seen the code. In your implementation, you need this specification since you can choose. In the C implementation, or in any other ''lowlevel'' implementation, it is not a need since the choice is one: we must put bits so that the leftmost is the most significative, and rightmost the less significative (which is, so to say, the ''mathematical'' convention). How these ''significative'' bits are aligned into the container, is a choice of the implementation. The only important thing is that if I wanted to output the 4 bits 1100, then the only byte of output must be 0xC0 (i.e. 1100'''0000''' where bold bits are just for padding). In this way, when reading, the first bit will be 1, the second 1, the third 0 and the fourth 0. If we put one bit after another according to the reading order, we obtain 1100 (and we must obtain 1100 also if we read the bits in just one shot). This is the way ''bit oriented'' is meant. --[[User:ShinTakezou|ShinTakezou]] 22:07, 20 December 2008 (UTC)
 
<blockquote>
# The thing you mean is the binary positional numeral system, which provides a notation of natural numbers. An unrelated issue, also.
# Your task, speaking mathematically, is about [bijective] mapping of ordered sets of bits onto ordered sets of numbers from the range 0..2<sup>N-1</sup>.
# I don't want to comment on [[C]], but an argumentation that C does something hard cannot serve as an argument.
# Mathematically there is no "first" and "last" bits of numbers. Number is an integral entity. There are '''encoding''' and representations of numbers in the memory of a computer. Only a representation of the number may have first bits, provided that memory bits are ordered in some way. Which BTW is not the case on most modern architectures, and never was the case for files. So it does not make any sense anyway.
--[[User:Dmitry-kazakov|Dmitry-kazakov]] 09:08, 21 December 2008 (UTC)
</blockquote>