<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C ++ &#187; Nibble</title>
	<atom:link href="http://www.bizzymicbizness.com/cplusplus/tag/nibble/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bizzymicbizness.com/cplusplus</link>
	<description>All about C++</description>
	<lastBuildDate>Mon, 19 Oct 2009 12:38:17 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Representing a Byte</title>
		<link>http://www.bizzymicbizness.com/cplusplus/representing-a-byte</link>
		<comments>http://www.bizzymicbizness.com/cplusplus/representing-a-byte#comments</comments>
		<pubDate>Sun, 30 Aug 2009 09:57:25 +0000</pubDate>
		<dc:creator>BMB</dc:creator>
				<category><![CDATA[Variable and Data Types]]></category>
		<category><![CDATA[256]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[Byte]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Characters]]></category>
		<category><![CDATA[HI nibble]]></category>
		<category><![CDATA[HIBIT]]></category>
		<category><![CDATA[High Order bit]]></category>
		<category><![CDATA[High Order nibble]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[LO nibble]]></category>
		<category><![CDATA[LOBIT]]></category>
		<category><![CDATA[Low Order bit]]></category>
		<category><![CDATA[Low Order nibble]]></category>
		<category><![CDATA[Nibble]]></category>

		<guid isPermaLink="false">http://www.bizzymicbizness.com/cplusplus/?p=233</guid>
		<description><![CDATA[(Image-1) Byte
 

A byte

Is a group of eight consecutive bits (Image-1)
The bits are counted from right to left starting at 0
Is considered as being made of two nibbles (Image-2)


 The most right bit

Is bit 0
It is called the least significant bit
It is also referred to as the Low Order bit, the LO bit, or LOBIT


The most left [...]]]></description>
			<content:encoded><![CDATA[<p>(Image-1) Byte</p>
<p style="TEXT-ALIGN: center"> <img class="size-full wp-image-234 aligncenter" title="Byte" src="http://www.bizzymicbizness.com/cplusplus/wp-content/uploads/2009/08/Byte1.jpg" alt="Byte" width="336" height="174" /></p>
<p><br class="blank" /><br />
A byte</p>
<ul>
<li>Is a group of eight consecutive bits (Image-1)</li>
<li>The bits are counted from right to left starting at 0</li>
<li>Is considered as being made of two nibbles (Image-2)</li>
</ul>
<p><br class="blank" /><br />
 The most right bit</p>
<ul>
<li>Is bit 0</li>
<li>It is called the least significant bit</li>
<li>It is also referred to as the Low Order bit, the LO bit, or <strong>LOBIT</strong></li>
</ul>
<p><br class="blank" /><br />
The most left bit</p>
<ul>
<li>Is bit 7</li>
<li>It is called the most significant bit</li>
<li>It is also referred to as the High Order bit, the HI bit, or <strong>HIBIT</strong></li>
</ul>
<p><br class="blank" /><br />
The other bits</p>
<ul>
<li>Are referred to following their positions</li>
</ul>
<p><br class="blank" /><br />
(Image-2)</p>
<p style="TEXT-ALIGN: center"> <img class="aligncenter size-full wp-image-235" title="Two nibbles" src="http://www.bizzymicbizness.com/cplusplus/wp-content/uploads/2009/08/Byte2.jpg" alt="Two nibbles" width="512" height="222" /></p>
<p><br class="blank" /><br />
The right nibble (Image-2)</p>
<ul>
<li>Made of the right 4 bits</li>
<li>Is called the Low Order nibble or LO nibble</li>
</ul>
<p><br class="blank" /><br />
The left nibble (Image-2)</p>
<ul>
<li>made of the left 4 bits</li>
<li>Is called the High Order nibble or HI nibble</li>
</ul>
<p><br class="blank" /><br />
Using the binary system</p>
<ul>
<li>you can represent the byte using a combination of 0s and 1s (B-1)</li>
</ul>
<p><br class="blank" /><br />
(B-1) When all bits have a value of 0</p>
<ul>
<li>The byte is represented as 00000000</li>
</ul>
<p><br class="blank" /><br />
(B-1) When all bits have a value of 1</p>
<ul>
<li>The byte is represented as 11111111</li>
</ul>
<p><br class="blank" /><br />
When the number grows very large</p>
<ul>
<li>It becomes difficult to read. Therefore, we will represent bits in groups of four (B-2)</li>
</ul>
<p><br class="blank" /><br />
(B-2) Instead of writing 00000000</p>
<ul>
<li>We will write it as  0000 0000</li>
</ul>
<p><br class="blank" /><br />
Create combinations of bits using the boxes as we did for the nibble</p>
<ul>
<li>2<sup>8</sup>, which is 256.</li>
<li>There are 256 possible combinations.</li>
</ul>
<p><br class="blank" /><br />
Another way to find it out is by using the base 2 technique:</p>
<ul>
<li>2<sup>7</sup> + 2<sup>6</sup> + 2<sup>5</sup> + 2<sup>4</sup> + 2<sup>3</sup> + 2<sup>2</sup> + 2<sup>1</sup> + 2<sup>0</sup><br />
= 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1<br />
= 255</li>
<li>Therefore, the maximum decimal value you can store in a byte is 255</li>
</ul>
<p><br class="blank" /><br />
Remember that the byte with all bits having a value of 0</p>
<ul>
<li>Has its value set to 0</li>
<li>Since this byte also holds a valid value, the number of combinations = 255 + 1 = 256</li>
</ul>
<p><br class="blank" /><br />
When a byte is completely represented with 0s</p>
<ul>
<li>It provides the minimum value it can hold</li>
<li>This is 0000 0000, which is also 0</li>
</ul>
<p><br class="blank" /><br />
When all bits have a value of 1</p>
<ul>
<li>Which is 1111 1111, a byte holds its maximum value that we calculated as 255 in the decimal system</li>
<li>As done with the nibble, we get the following table (Image-3):</li>
</ul>
<p><br class="blank" /><br />
(Image-3)</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-237" title="Table" src="http://www.bizzymicbizness.com/cplusplus/wp-content/uploads/2009/08/Table.jpg" alt="Table" width="342" height="60" /></p>
<p><br class="blank" /><br />
The minimum storage area offered by the (Intel) computer</p>
<ul>
<li>Is the byte</li>
</ul>
<p><br class="blank" /><br />
As you know already</p>
<ul>
<li>A byte is a group of 8 consecutive bits</li>
</ul>
<p><br class="blank" /><br />
The amount of memory space offered by a byte</p>
<ul>
<li>Can be used to store just a single symbol, such as those you see on your keyboard</li>
</ul>
<p><br class="blank" /><br />
These symbols, also called characters, have been organized</p>
<ul>
<li>The American Standard Code for Information Exchange (ASCII) in a set list</li>
<li>But, ASCII uses only 128 decimal numbers (based on a 7-bit format) to represent symbols counted from 0 to 127</li>
<li>To compensate for the remaining 1 bit, IBM used it to organize special characters, foreign language characters, mathematical symbols, small graphics, etc</li>
<li>Each one of these characters has a decimal, a hexadecimal, and a binary equivalents</li>
</ul>
<p><br class="blank" /><br />
Each one of the characters you see on your keyboard</p>
<ul>
<li>Is represented as a numeric value, but whether it appears as a number, a letter, or a symbol, each one of these is considered a character</li>
</ul>
<p><br class="blank" /><br />
To display any character on your screen</p>
<ul>
<li>you can use the <strong>cout &lt;&lt;</strong> operator and include the character between single-quotes, as (A-1)</li>
</ul>
<p><br class="blank" /><br />
Example of (A-1)</p>

<div class="syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;iostream&gt;</span>
&nbsp;
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
&nbsp;
     <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">'a'</span><span style="color: #008080;">;</span>
&nbsp;
     <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bizzymicbizness.com/cplusplus/representing-a-byte/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Four-Bit Combination</title>
		<link>http://www.bizzymicbizness.com/cplusplus/the-four-bit-combination</link>
		<comments>http://www.bizzymicbizness.com/cplusplus/the-four-bit-combination#comments</comments>
		<pubDate>Fri, 28 Aug 2009 04:18:22 +0000</pubDate>
		<dc:creator>BMB</dc:creator>
				<category><![CDATA[Variable and Data Types]]></category>
		<category><![CDATA[Binary System]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Decimal System]]></category>
		<category><![CDATA[HI bit]]></category>
		<category><![CDATA[LO bit]]></category>
		<category><![CDATA[Nibble]]></category>

		<guid isPermaLink="false">http://www.bizzymicbizness.com/cplusplus/?p=169</guid>
		<description><![CDATA[(Image-1) Nibble


Nibble

Is represented by a group of 4 bits = 1/2 byte
This is also a system that the computer uses to count bits internally


The first bit, on the right side of the nibble

Is called the Low Order bit or LO bit
This is also called the least significant bit
The bit on the right side is counted [...]]]></description>
			<content:encoded><![CDATA[<p>(Image-1) Nibble</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-173" title="Nibble" src="http://www.bizzymicbizness.com/cplusplus/wp-content/uploads/2009/08/Nibble.jpg" alt="Nibble" width="270" height="238" /></p>
<p><br class="blank" /></p>
<p>Nibble</p>
<ul>
<li>Is represented by a group of 4 bits = 1/2 byte</li>
<li>This is also a system that the computer uses to count bits internally</li>
</ul>
<p><br class="blank" /></p>
<p>The first bit, on the right side of the nibble</p>
<ul>
<li>Is called the Low Order bit or LO bit</li>
<li>This is also called the least significant bit</li>
<li>The bit on the right side is counted as bit 0</li>
</ul>
<p><br class="blank" /></p>
<p>The last bit, on the left side of the nibble</p>
<ul>
<li>Is called the High Order bit or HI bit</li>
<li>It is also called the most significant bit</li>
<li>The bit on the left side is counted as bit 3</li>
</ul>
<p><br class="blank" /></p>
<p>The other bits</p>
<ul>
<li>Are called by their positions: bit 1 and bit 2</li>
</ul>
<p><br class="blank" /></p>
<p>When a box is empty</p>
<ul>
<li>It receives a value of 0</li>
<li>Otherwise, it has a value of 1</li>
</ul>
<p><br class="blank" /></p>
<p>(Image-2) On a group of four consecutive bits, we can have the following combinations:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-174" title="Combination" src="http://www.bizzymicbizness.com/cplusplus/wp-content/uploads/2009/08/Combination.jpg" alt="Combination" width="428" height="237" /></p>
<p><br class="blank" /></p>
<p> The (Image-2) produces the following binary combinations:</p>
<ul>
<li>0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111 = 16 combinations</li>
<li>When using the decimal system, these combinations can be represented as 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15</li>
</ul>
<p><br class="blank" /></p>
<p>You will encounter a number that is less than four bits</p>
<ul>
<li>(B-1) Such as 10 or 01 or 101</li>
</ul>
<p><br class="blank" /></p>
<p>How do you reconcile such a number to a nibble?</p>
<ul>
<li>(B-1) The technique used to complete and fill out the nibble consists of displaying 0 for each non-represented bit</li>
</ul>
<p><br class="blank" /></p>
<p>Example of (B-1)</p>
<ul>
<li>The binary number 10 will be the same as 0010</li>
<li>The number 01 is the same as 0001</li>
<li>The number 101 is the same as 0101</li>
</ul>
<p><br class="blank" /></p>
<p>This technique is valuable and allows you to always identify</p>
<ul>
<li>A binary number as a divider of 4</li>
</ul>
<p><br class="blank" /></p>
<p>When all bits of a nibble are 0</p>
<ul>
<li>You have the lowest value you can get, which is 0000</li>
<li>Any of the other combinations has at least one 0 bit</li>
<li>The lowest value, also considered the minimum value, can be represented in the decimal system as 0</li>
</ul>
<p><br class="blank" /></p>
<p>When all bits are 1</p>
<ul>
<li>This provides the highest value possible for a nibble</li>
<li>The highest value, also considered the maximum, can be expressed in decimal value as 2<sup>4</sup> (2 represents the fact that there are two possible states: 0 and 1; 4 represents the fact that there are four possible combinations), which is 16. This produces 16 because 2<sup>4</sup> = 16</li>
</ul>
<p><br class="blank" /></p>
<p>The computer recognizes</p>
<ul>
<li>The hexadecimal representation of bits</li>
</ul>
<p><br class="blank" /><br />
(Image-2) We can represent each 4-bit of the sixteen combinations using the decimal, hexadecimal, and binary systems as follows: </p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-183" title="Table of Numeric Conversions" src="http://www.bizzymicbizness.com/cplusplus/wp-content/uploads/2009/08/Table-of-Numeric-Conversions.jpg" alt="Table of Numeric Conversions" width="258" height="373" /></p>
<p><br class="blank" /><br />
When looking at a binary value represented by 4 bits</p>
<ul>
<li>You can get its decimal or hexadecimal values by referring to the table (Image-2)</li>
</ul>
<p><br class="blank" /><br />
A nibble, which is a group of four consecutive bits</p>
<ul>
<li>Has a minimum and maximum values on each system as follows (Image-3):</li>
<li>Although the C++ compiler recognizes a group of four consecutive bits</li>
<li>You cannot store any variable in a nibble</li>
<li>You can, however, manipulate the bits of a nibble</li>
</ul>
<p><br class="blank" /><br />
(Image-3)</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-182" title="Minimum and maximum values on each system" src="http://www.bizzymicbizness.com/cplusplus/wp-content/uploads/2009/08/Minimum-and-maximum-values-on-each-system.jpg" alt="Minimum and maximum values on each system" width="349" height="63" /></p>
<p><br class="blank" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzymicbizness.com/cplusplus/the-four-bit-combination/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

