Skip to content

Commit

Permalink
Start off Section 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nayakrujul committed Feb 13, 2024
1 parent d60f7fb commit af4d6d1
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CompSci/2B-Summary-Questions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ <h3 class="home-link"><a href="../">Computer Science Revision</a></h3>

<br /> <br />

<a class="next-link" href="../3-01-Storage-Units/">Next: 3.01 - Storage Units</a>

<br /> <br />
<br /> <br />

<div id="sub">© Rujul Nayak <el id="year">2024-</el></div>
<script src="../../year.js"></script>

Expand Down
168 changes: 168 additions & 0 deletions CompSci/3-01-Storage-Units/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<!DOCTYPE html>

<html>
<head>
<link rel="stylesheet" href="../../main.css">
<link rel="stylesheet" href="../main.css">

<title>Computer Science Revision</title>

<link rel="icon" type="image/png" href="../icons/logo.svg"/>
<meta property="og:image" content="../icons/logo.png" />
<meta property="og:image:width" content="640" />
<meta property="og:image:height" content="512" />

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="2B.08 - Translators | Computer Science Revision">
</head>

<body>
<h1>3.01 &ndash; Storage Units</h1>
<h3 class="home-link"><a href="../">Computer Science Revision</a></h3>
<br />

<a class="prev-link" href="../2B-Summary-Questions/">Previous: Section 2B Summary Questions</a>
<br /> <br />

<p class="definition">
<img src="../icons/book.svg" class="icon" />
The <strong>binary number system</strong> is a way of writing numbers with only 1s and 0s.
</p>

<p><b>Everything on a computer (text, images, apps, etc.) is stored in binary.</b></p>

<p>
Computers use 1s and 0s to represent ON and OFF: <br />
&ensp; 1 means the electricity is flowing (ON) <br />
&ensp; 0 means the electricity isn't flowing (OFF)
</p>

<p><br />
A single <b>bi</b>nary digi<b>t</b> (either a 1 or a 0) is called a <b>bit</b>. <br />
A group of four bits is called a <b>nibble</b>, and a group of eight bits (or two nibbles) is called a <b>byte</b>.
</p>

<p><br />Just like 1000 metres is a <b>kilo</b>metre, 1000 bytes is a <b>kilo</b>byte.<br />&nbsp;</p>

<p>Table 1 shows the more common prefixes used when describing memory usage.</p>

<p class="table">
<img src="../icons/table.svg" class="icon" />
Table 1
</p>

<table>
<tr>
<th><strong>Unit</strong></th>
<th><strong>Number of bytes</strong></th>
</tr>
<tr>
<td>
Kilobyte <i>(kB)</i>
</td>
<td>
<code>10<sup>3</sup></code> = 1,000 bytes
</td>
</tr>
<tr>
<td>
Megabyte <i>(MB)</i>
</td>
<td>
<code>10<sup>6</sup></code> = 1,000,000 bytes
</td>
</tr>
<tr>
<td>
Gigabyte <i>(GB)</i>
</td>
<td>
<code>10<sup>9</sup></code> = 1,000,000,000 bytes
</td>
</tr>
<tr>
<td>
Terabyte <i>(TB)</i>
</td>
<td>
<code>10<sup>12</sup></code> = 1,000,000,000,000 bytes
</td>
</tr>
</table>

<br />

<p>Table 2 shows the less common prefixes used when describing memory usage.</p>

<p class="table">
<img src="../icons/table.svg" class="icon" />
Table 2
</p>

<table>
<tr>
<th><strong>Unit</strong></th>
<th><strong>Number of bytes</strong></th>
</tr>
<tr>
<td>
Kibibyte <i>(KiB)</i>
</td>
<td>
<code>2<sup>10</sup></code> = 1,024 bytes
</td>
</tr>
<tr>
<td>
Mebibyte <i>(MiB)</i>
</td>
<td>
<code>2<sup>20</sup></code> = 1,048,576 bytes
</td>
</tr>
<tr>
<td>
Gibibyte <i>(GiB)</i>
</td>
<td>
<code>2<sup>30</sup></code> = 1,073,741,824 bytes
</td>
</tr>
<tr>
<td>
Tebibyte <i>(TiB)</i>
</td>
<td>
<code>2<sup>40</sup></code> = 1,099,511,627,776 bytes
</td>
</tr>
</table>

<br />

<hr />

<p class="question">
<img src="../icons/question.svg" class="icon" />
If each bit can take 2 possible values (1 or 0), how many possible values can a nibble take?
</p>

<p class="spoiler noselect">
<el class="default">Tap/click to reveal</el>
<el class="answer">
Each bit in the nibble can take 2 possible values, so the nibble can take <code>2<sup>4</sup> = 2 &times; 2 &times; 2 &times; 2</code> = 16 possible values.
</el>
</p>

<br />

<hr />

<br /> <br />

<div id="sub">© Rujul Nayak <el id="year">2024-</el></div>
<script src="../../year.js"></script>

<script src="../spoilers.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions CompSci/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ <h3><strong>Section 2B - Programming Techniques</strong></h3>
<li><a href="./2B-Summary-Questions/">Summary Questions</a></li>
</ul>

<h3><strong>Section 3 - Data Representation</strong></h3>

<ul>
<li><a href="./3-01-Storage-Units/">3.01 - Storage Units</a></li>
</ul>

<br />
<br />

Expand Down

0 comments on commit af4d6d1

Please sign in to comment.