This page (revision-1) was last changed on 29-Nov-2024 16:16 by UnknownAuthor

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 added 54 lines
!!! Overview
[{$pagename}] ([Base-2]) is a [Positional notation] [number] system and typically a [Data type] and a [Data representation]
Specific details of the [Data type] [{$pagename}] are context dependent.
!! Binary Numbers
Binary numbers with only one bit set is easy to understand:
||[{$pagename}] Representation||[Decimal] value
|00000000000000000000000000000001|1
|00000000000000000000000000000010|2
|00000000000000000000000000000100|4
|00000000000000000000000000001000|8
|00000000000000000000000000010000|16
|00000000000000000000000000100000|32
|00000000000000000000000001000000|64
!! [{$pagename}] and [Computers] [1]
When we write what is stored in a [computer] on paper, we normally use “0” for one of the [states], and “1” for the other [state]. For [example], a piece of computer memory could have the following voltages:
{{{low low high low high high high high low high low low}}}
We could allocate “0” to “low” (or [False]), and “1” to “high” (or [True]) and write this sequence down as:
{{{0 0 1 0 1 1 1 1 0 1 0 0}}}
While this notation is used extensively, and you may often hear the [data] being referred to as being “0’s and 1’s”, it is important to remember that a [computer] does not store 0’s and 1’s; it has no way of doing this. They are just using physical mechanisms such as "high" and "low" voltage, north or south polarity, and light or dark materials.
!! Converting [Decimal] to [{$pagename}]
[JavaScript] [Example]
%%prettify
{{{
function dec2bin(dec){
return (dec >>> 0).toString(2);
}
}}}
/%
!! Converting [{$pagename}] to [Decimal]
[JavaScript] [Example]
%%prettify
{{{
function bin2dec(bin){
return parseInt(bin, 2).toString(10);
}
}}}
/%
!! More Information
There might be more information for this subject on one of the following:
[{ReferringPagesPlugin before='*' after='\n' }]
----
* [#1] - [Data Representation|http://csfieldguide.org.nz/en/chapters/data-representation.html|target='_blank'] - based on information obtained 2018-09-17-