TEJ2O
Number Systems
Number Systems
Welcome to TEJ2O - Introduction to Computer Engineering. Computer Engineering is a discipline that integrates several fields of electrical engineering and computer science required to develop computer systems. Computer engineers usually have training in electronic engineering, software design, and hardware-software integration instead of only software engineering or electronic engineering. Computer engineers are involved in many hardware and software aspects of computing, from the design of individual microprocessors, personal computers, and supercomputers, to circuit design. This field of engineering not only focuses on how computer systems themselves work, but also how they integrate into the larger picture.
Source: WikipediaYou are responsible for knowing these rules. The over-riding principle is that computers are to be used strictly for educational purposes only.
You are not allowed to eat or drink (water may be left at desk) near the computers
Do not share your passwords with others. Do not let anyone else use your account!
You are not allowed to play games, apart from games that are part of your course work. No commercially prepared games can be brought into the lab or installed please.
You are not allowed to have streaming video. (too much bandwidth).
Do not bring bags and coats into the lab.
Do not alter things like the desktop/system files without permission
To get used to the computers and our computer network, you are to complete simple assignment whereby you will create a Google Site that you will use to submit some assignments in the course. You will create the main Site that will be about you (include some details about yourself, some pictures and/or embedded content). Off of that main page include several sub-pages that will be titled with each unit of the course (number systems, computer systems, networking, electronics) Somewhere on the site, you must include the answer to the Ultimate Question of Life, the Universe and Everything. On your main page I want you to create an entry called Assignment #1. Answer the following questions in that section:
What are elements of computer technology you feel are important
What don't you like about computer technology as a whole
What is the thing you like most about computer technology
The goal of this assignment is mostly to ensure you have remembered the Appropriate use of Technology Policy of the OCDSB as well as the discussion about our school network and submission protocol. You will submit the published link to the Google Site in the Classroom Assignment. If you're looking for resources beyond what's described in class check out Google's information page(s).
Concept Check
A numeral system (or system of numeration) is a writing system for expressing numbers, that is a mathematical notation for representing numbers of a given set, using graphemes or symbols in a consistent manner. It can be seen as the context that allows the symbols "11" to be interpreted as the binary symbol for three, the decimal symbol for eleven, or a symbol for other numbers in different bases. (source)
At first, it would seem like using any number system other than decimal is complicated and unnecessary. However, since the job of electrical and software engineers is to work with digital circuits, engineers require number systems that can best transfer information between the human world and the digital circuit world and those forms are usually binary, octal, or hexadecimal. It turns out that the way in which a number is represented can make it easier for the engineer to perceive the meaning of the number as it applies to a digital circuit. In other words, the appropriate number system can actually make things less complicated.
While useful in their own right, often numbers are more meaningful in another number system. For example, an electrical engineer who is working on a hexadecimal "programming layer", may want to translate something into a binary "machine layer", as such, they need to be able to convert quickly between the base 16 number system (HEX) to the base 2 number system (BIN, or 0b).
The three systems of interest for us are decimal (dec), binary (bin) and hexadecimal (hex).
To convert between Decimal and Binary you can either arrange the columns by their respective placeholders, or use the remainder method of conversion
Consider the number 294. The steps below show how to convert this number to binary using repeated division by 2. The 'R' stands for the remainder of the division
An easy method of converting decimal to binary number equivalents is to write down the decimal number and to continually divide-by-2 (two) to give a result and a remainder of either a “1” or a “0” until the final result equals zero. If there's a non-perfect division (e.g. the remainder is 0.5) then the remainder becomes 1 and the number rounds down.
NOTE: THE FIRST DIVISION IS ON THE RIGHT, THE LAST DIVISION IS ON THE LEFT
e.g. the number 294
divided by 2
is evenly 147 with a remainder of 0
divided by 2
is 73.5->73 (there's a decimal so we round down) and the remainder is 1
divided by 2
is 36.5->36 with a remainder of 1 (rounded down and the # becomes 36 with the R =1)
divided by 2
is evenly18 with a remainder of 0
divided by 2
is evenly 9 with a remainder of 0
divided by 2
is 4.5->4 with a remainder of 1
divided by 2
is evenly 2 with a remainder of 0
divided by 2
is evenly 1 with a remainder of 0
divided by 2
is 0.5->0 with a remainder of 1
So the number's : 1 0010 0110
You could also just do raw-figuring using the subtraction method. Let's take the number 114
114 isn't bigger than 128 so there are no 128's
114 IS bigger than 64 so it contributes 1 and we subtract 64 from 114 leaving 50
50 is bigger than 32 so we take 32 away from 50 leaving 18
18 is bigger than 16 so we take away 16 from 32 leaving 2
2 isn't bigger than 8 so it contributes 0
2 isn't bigger than 4 so it contributes 0
2 is subtracted at the 2's column leaving 0
there's nothing left to subtract in the 1's column so it's 0
So 114 is: 01110010 in 0b (but we generally don't show leading 0's so 1110010)
To convert binary to decimal is relatively easy. All you have to do is list out the columns, then add up representative placeholders. Let's say for example we want to convert 101101(0b) to dec:
32 + 8 + 4 + 1 = 45
You can also use the dividing approach as with binary, but with alterations. Here are the steps:
Step 1: Divide the number by 16. Store the whole number for the next step. Take the decimal remainder (if there is one) and multiply by 16. Store it.
Step 2: Take the whole number from the last step and divide by 16 as per the last step. Repeat these 2 steps until the last whole number is 0. This will be the last step
Step 3: The final hexadecimal value will be the reverse order you stored (like in dec to bin conversions)
EG Decimal number = 450(10)
Step 1: 450/16 gives 28.125, Store 28 for the next step. Multiply 16x0.125=2 so the remainder = 2
Step 2: 28/16 gives 1.75; Store 1 for the next step. Multiply 16x1.75 = 16, with a remainder of 12 = C
Step 3: 1/16 gives 0; 16x0 and remainder = 1
Step 4: 0/16 gives 0 and remainder = 0
Therefore, the hexadecimal value is 01C2(16)
EG Decimal number = 118(10)
Step 1: 118/16 gives 7.375, Store 7 for the next step. Multiply 16x0.375=6 so the remainder = 6
Step 2: 7/16 gives 0.4375; Store 0 for the next step. Multiply 16x.4375 = 7, remainder of 7
Step 3: 0/16 gives 0 and remainder = 0
Therefore, the hexadecimal value is 076(16)
Is exactly like converting binary to decimal, simply list out the columns and add the results.
Let's take the number 1D16
16's column | 1's column
(1 x 16) + (13 x 1) = 2910
How about this one A6316
256's column | 16's column | 1's column
(10x256) + (6x16) + (3x1) = 265910
Try this:
C0216 to base 10 (equals 3074 )
This is the easiest type of conversion because we break the columns in hex down into 'octets' (also known as a byte).
To convert we simply break the Hex into two separate column, then assign the binary values to the octet. To convert hexadecimal F8 to binary, write down the binary for F first, then the binary for 8.
So, the answer is 1111 1000
This seems too easy, and it is. Use a calculator to convince yourself. Convert hex number 1A to binary.
Answer: 0001 1010
Is the exact same as HEX to BIN, but in reverse. To convert, we break the binary value into octects, then convert each to hex separately. Let's convert 10110 to HEX. First break it into octects and include leading zeroes on the octet to the left
As you can see it's 16
Step 1:
0001 0110
Step 2 (convert each octet to hex)
1 6
What about the binary number 1101101
0110 1101
6 13 (which is D)
So the HEX value is 6D. Pretty easy!
Go to the following website, or watch the youtube video in Classroom or refer to our notes. Answer the questions from the google doc worksheet and when you're finished post it on your Google Site as Assignment #2 on the Number Systems webpage
Evaluation includes Quiz#1 - Number Conversions
Be able to convert from
dec to bin, bin to dec
dec to hex, hex to dec
hex to bin bin to hex
ASCII (American Standard Code for Information Interchange) is the most common character encoding format for text data in computers and on the internet. In standard ASCII-encoded data, there are unique values for 128 alphabetic, numeric or special additional characters and control codes.
ASCII encoding is based on character encoding used for telegraph data.
Characters in ASCII encoding include upper- and lowercase letters A through Z, numerals 0 through 9 and basic punctuation symbols. It also uses some non-printing control characters that were originally intended for use with teletype printing terminals when the system was developed in 1963
As far as we're concerned, ASCII characters may be represented in the following ways. Let's take the letter Z (capital):
as pairs of hexadecimal digits (eg 5A)
as decimal numbers from 0 to 127; (eg 90) or
as binary (101 1010)
Open NOTEPAD. Hold down the ALT key and enter the ascii decimal code. E.g. ALT+90
What character is brought up
try using this chart to try a few more. This is an extended table for even MORE.
This website can provide more details about ASCII
The attached ‘Chart’ and its associated detail describe the ASCII character set, and its associated controls. The chart, itself, is outlined with ‘Hexadecimal’ numbers, decimal numbers and binary values.
Since a computer at the machine level can process ‘only’ binary code, all input (from programs to simple keyboarding) must be converted to binary before the ‘processor’ can process it. This exercise will demonstrate the extreme detail the computer must deal with in order to convert your ‘computer input’ into something others can understand.
For this exercise you are going to be the computer. You must convert the ‘Keyboard entry’ (Which is in ASCII) into binary, send it to the ‘Processor’ and have it processed then sent to the screen. You will convert a message into binary, then process and ‘decode’ your message.
The assignment
Convert a 5 word messages (of your choice) into hex, then from hex to Binary.
Have a neighbour convert your "Received Message’ into decimal as the entry method, then using ALT+Keypad to convert to 'SCREEN' (the visual symbols).
Get them to send a message to you.
Show your work in converting your message from hex (on the ASCII table) to binary. You can use an online calculator for the conversion (no need to convert manually).
HINT:
Message: Hello out there.
Translating :
Into Hexadecimal (look up on the table)
H=48 e=65 l=6C l=6C o=6F SPC=20 o=6F u=75 t=74 SPC=20 t=74 h=68 e=65 r=72 e=65 .=2E
Into Binary
01001000|01100101|01101100|01101100|01101111|00100000|01101111|01110101|01110100
0010000|00111010|00110100|00110010|10111001|00110010|100101110
Receiver turns it into decimal for key entry into Notepad (or use an online converter and just skip the decimal step if you want)
72 101 108 108 111 32 111 117 116 32 116 104 101 114 101 46
Google Doc worksheet for both sent and received messages
Concept Check