(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:ECE270]]
+
<br>
[[Category:ECE]]
+
[[Category:digital systems]]
+
[[Category:Lecture_notes]]
+
[[Category:Slecture]]
+
 
+
+
 
<center><font size="4"></font>  
 
<center><font size="4"></font>  
<font size="4">'''[[ECE_270_Digital_System_Design_Slecture_Wayner_Table_of_Contents|The Meyer Lectures on Digital Systems]]''' </font>  
+
<font size="4">'''[[ECE 270 Digital System Design Slecture Wayner Table of Contents|The Meyer Lectures on Digital Systems]]''' </font>  
  
 +
<br> '''Module 1: Boolean Algebra &amp; CMOS logic structures'''
  
'''Module 1: Boolean Algebra &amp; CMOS logic structures'''
+
1.1 Converting integers to binary  
+
1.1 Converting integers to binary
+
  
[[slectures|Slectures]] by [[User:Rwayner|Robert Wayner]]  
+
[https://www.projectrhea.org/learning/slectures.php Slectures] by [[User:Rwayner|Robert Wayner]]  
  
 
© 2013  
 
© 2013  
 
</center>  
 
</center>  
 
----
 
----
== Introduction ==
+
 
<div style="margin-left: 3%"> Everyday we view numbers and use them for our work, studies or just for fun. The key factor is how we can understand these numbers and then use them. But how can we get a computer to recognize regular, everyday numbers such as 2013, 777 and 123? A basic computer cannot recognize these numbers in this form but we can change the form to a more logical, algorithmic form. This logical form which is known as binary has been made specifically for computers to be able to read and interpret numbers. This Slecture will describe how to convert normal everyday number format to binary.  
+
== Introduction ==
</div>
+
<div style="margin-left: 3%">Everyday we view numbers and use them for our work, studies or just for fun. The key factor is how we can understand these numbers and then use them. But how can we get a computer to recognize regular, everyday numbers such as 2013, 777 and 123? A basic computer cannot recognize these numbers in this form but we can change the form to a more logical, algorithmic form. This logical form which is known as binary has been made specifically for computers to be able to read and interpret numbers. This Slecture will describe how to convert normal everyday number format to binary. </div>  
==Examples of binary and basic binary to integer translation==
+
== Examples of binary and basic binary to integer translation ==
 
<div style="margin-left: 3%">
 
<div style="margin-left: 3%">
 
Binary uses only 2 numbers, 0 and 1. When dealing with logic situations and boolean algebra, 0 means 'false' and 1 means 'true'. A binary number can look like the following:  
 
Binary uses only 2 numbers, 0 and 1. When dealing with logic situations and boolean algebra, 0 means 'false' and 1 means 'true'. A binary number can look like the following:  
  
<math>001, 1011, 10101010101, \text{ etc.}</math>  
+
<span class="texhtml">001,1011,10101010101, etc.</span>  
  
 
Also, there is no limit to how big these binary numbers can be.  
 
Also, there is no limit to how big these binary numbers can be.  
  
 +
<br> Before we can begin converting, we have to figure out how binary works. Lets analyze what each 0 and 1 represents in a few strings of binary.
  
Before we can begin converting, we have to figure out how binary works. Lets analyze what each 0 and 1 represents in a few strings of binary.
+
<span class="texhtml">11111 = 1 * 2<sup>4</sup> + 1 * 2<sup>3</sup> + 1 * 2<sup>2</sup> + 1 * 2<sup>1</sup> + 1 * 2<sup>0</sup> = 16 + 8 + 4 + 2 + 1 = 31</span>
  
<math> 11111 = 1*2^4+1*2^3+1*2^2+1*2^1+1*2^0 = 16+8+4+2+1 = 31</math>
+
As shown above, each integer (each 1 in this case) represents a product (you mean power? )of 2. Starting from the right to the left, the exponent of 2 increments from 0 to the length of the binary term minus 1.
  
As shown above, each integer (each 1 in this case) represents a product (you mean power? )of 2. Starting from the right to the left, the exponent of 2 increments from 0 to the length of the binary term minus 1. 
+
Lastly its important to notice that if a product of 2 is represented with a 0, you multiply that product of 2 with 0 or simply ignore it in your adding process. With this knowledge, we can begin converting binary to regular numbers.  
 
+
Lastly its important to notice that if a product of 2 is represented with a 0, you multiply that product of 2 with 0 or simply ignore it in your adding process. With this knowledge, we can begin converting binary to regular numbers.
+
  
 
'''Example''': Convert 1011 to a number.  
 
'''Example''': Convert 1011 to a number.  
  
 
'''Solution''':  
 
'''Solution''':  
:<math>1\times 2^3+0\times 2^2+1\times 2^1+1 \times 2^0 = 8+0+2+1 = 11</math>  
+
 
</div>
+
:<span class="texhtml">1×2<sup>3</sup> + 0×2<sup>2</sup> + 1×2<sup>1</sup> + 1×2<sup>0</sup> = 8 + 0 + 2 + 1 = 11</span>
==Recognizing different bases of numbers and binary==
+
</div>  
 +
== Recognizing different bases of numbers and binary ==
 
<div style="margin-left: 3%">
 
<div style="margin-left: 3%">
Numbers that we use everyday, like 7 and 9 are base 10, which means the ones, tenths, hundredths, etc can go from 0 to 9.
+
Numbers that we use everyday, like 7 and 9 are base 10, which means the ones, tenths, hundredths, etc can go from 0 to 9.  
  
Example of counting up a base 3 number: 0, 1, 2, 10, 11, 12, 10, 20, 21, 22, 100, 101,.....
+
Example of counting up a base 3 number: 0, 1, 2, 10, 11, 12, 10, 20, 21, 22, 100, 101,.....  
  
 
Noticed how the tenths digit stopped at the twenties? This is because it is base 3, in which the tenths can only go from 0 to 2. If we continue this counting process, we will reach 1000 much more quickly than a base 10 number.  
 
Noticed how the tenths digit stopped at the twenties? This is because it is base 3, in which the tenths can only go from 0 to 2. If we continue this counting process, we will reach 1000 much more quickly than a base 10 number.  
  
The largest base of numbers is base 16 which is from 0-F, meaning 0-9, A, B, C, D, E, F.
+
The largest base of numbers is base 16 which is from 0-F, meaning 0-9, A, B, C, D, E, F.  
  
''It is important to note that base 16 numbers will be used extensively for microprocessors and other types of computer design.''
+
''It is important to note that base 16 numbers will be used extensively for microprocessors and other types of computer design.''  
</div>
+
</div>  
==Base 10 to base 16 conversion example==
+
== Base 10 to base 16 conversion example ==
 
<div style="margin-left: 3%">
 
<div style="margin-left: 3%">
 
These conversions may seem tricky but there is a solid method to performing these conversions.  
 
These conversions may seem tricky but there is a solid method to performing these conversions.  
Line 62: Line 55:
 
'''Example''': Convert (2654)<sub>10</sub> to base 16  
 
'''Example''': Convert (2654)<sub>10</sub> to base 16  
  
[[Image:Base10to16conversion.png]]
+
[[Image:Base10to16conversion2.jpg|750x600px]]  
  
Notice how the remainders are the base 16 numbers we are looking for and that the quotients get passed down to another set of dividers. This algorithm continues until the last quotient is 0. Lastly, the final answer is formed by reading the remainders from right to left and writing them as a single term.
+
Notice how the remainders are the base 16 numbers we are looking for and that the quotients get passed down to another set of dividers. This algorithm continues until the last quotient is 0. Lastly, the final answer is formed by reading the remainders from right to left and writing them as a single term.  
</div>
+
</div>  
 
----
 
----
=Relevant Links=
+
 
*[[Media:ECE_270_Slecture_1.1_Notes.pdf|Accompanying lecture notes by Prof. Meyer]]
+
= Relevant Links =
 +
 
 +
*[[Media:ECE_270_Slecture_1.1_Notes.pdf|Accompanying lecture notes by Prof. Meyer]]  
 
*[[2013 Fall ECE 270 Brown|ECE 270 Homepage]]
 
*[[2013 Fall ECE 270 Brown|ECE 270 Homepage]]
 +
 
----
 
----
[[ECE_270_SLecture_Table_of_Contents|Back to table of content for "The Brown-Meyer Lectures on Digital Systems Design"]]
+
 
 +
[[ECE 270 SLecture Table of Contents|Back to table of content for "The Brown-Meyer Lectures on Digital Systems Design"]]
 +
 
 +
[[Category:ECE270]] [[Category:ECE]] [[Category:Digital_systems]] [[Category:Lecture_notes]] [[Category:Slecture]]

Latest revision as of 06:31, 26 February 2014


The Meyer Lectures on Digital Systems


Module 1: Boolean Algebra & CMOS logic structures

1.1 Converting integers to binary

Slectures by Robert Wayner

© 2013


Introduction

Everyday we view numbers and use them for our work, studies or just for fun. The key factor is how we can understand these numbers and then use them. But how can we get a computer to recognize regular, everyday numbers such as 2013, 777 and 123? A basic computer cannot recognize these numbers in this form but we can change the form to a more logical, algorithmic form. This logical form which is known as binary has been made specifically for computers to be able to read and interpret numbers. This Slecture will describe how to convert normal everyday number format to binary.

Examples of binary and basic binary to integer translation

Binary uses only 2 numbers, 0 and 1. When dealing with logic situations and boolean algebra, 0 means 'false' and 1 means 'true'. A binary number can look like the following:

001,1011,10101010101, etc.

Also, there is no limit to how big these binary numbers can be.


Before we can begin converting, we have to figure out how binary works. Lets analyze what each 0 and 1 represents in a few strings of binary.

11111 = 1 * 24 + 1 * 23 + 1 * 22 + 1 * 21 + 1 * 20 = 16 + 8 + 4 + 2 + 1 = 31

As shown above, each integer (each 1 in this case) represents a product (you mean power? )of 2. Starting from the right to the left, the exponent of 2 increments from 0 to the length of the binary term minus 1.

Lastly its important to notice that if a product of 2 is represented with a 0, you multiply that product of 2 with 0 or simply ignore it in your adding process. With this knowledge, we can begin converting binary to regular numbers.

Example: Convert 1011 to a number.

Solution:

1×23 + 0×22 + 1×21 + 1×20 = 8 + 0 + 2 + 1 = 11

Recognizing different bases of numbers and binary

Numbers that we use everyday, like 7 and 9 are base 10, which means the ones, tenths, hundredths, etc can go from 0 to 9.

Example of counting up a base 3 number: 0, 1, 2, 10, 11, 12, 10, 20, 21, 22, 100, 101,.....

Noticed how the tenths digit stopped at the twenties? This is because it is base 3, in which the tenths can only go from 0 to 2. If we continue this counting process, we will reach 1000 much more quickly than a base 10 number.

The largest base of numbers is base 16 which is from 0-F, meaning 0-9, A, B, C, D, E, F.

It is important to note that base 16 numbers will be used extensively for microprocessors and other types of computer design.

Base 10 to base 16 conversion example

These conversions may seem tricky but there is a solid method to performing these conversions.

Example: Convert (2654)10 to base 16

Base10to16conversion2.jpg

Notice how the remainders are the base 16 numbers we are looking for and that the quotients get passed down to another set of dividers. This algorithm continues until the last quotient is 0. Lastly, the final answer is formed by reading the remainders from right to left and writing them as a single term.


Relevant Links


Back to table of content for "The Brown-Meyer Lectures on Digital Systems Design"

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang