Presentation is loading. Please wait.

Presentation is loading. Please wait.

COP3502: Introduction to Computer Science Yashas Shankar Program Translation.

Similar presentations


Presentation on theme: "COP3502: Introduction to Computer Science Yashas Shankar Program Translation."— Presentation transcript:

1 COP3502: Introduction to Computer Science Yashas Shankar Program Translation

2 Second part of this course  We will spend 4 classes on Program Translation (chapter 6 from your AE textbook) and 3 classes on Hardware (chapter 7 from your AE textbook)  You need to have the textbook  You won’t have to do programming on program.cs.fsu.edu (but you still have to write some assembly programs on papers)  We will spend 4 classes on Ethics  Textbook is optional, but you may need it to do extra credits  We will also spend some times reviewing programming during this period

3 Extra credit  There will be 4 extra credits  2 for homework  2 for quizzes  For each extra credit, write a 5-page summary of one chapter from your “ethics” textbook

4 Alternative extra credit for homework  Do the homework that you want to have your score increase  Put your homework on your webpage  Write a 2-page summary of one chapter in Ethics textbook and put it on your webpage  15 points will come from your homework and 10 points from the summary. Grading policy on homework part will be tougher. Your homework has to be 100% correct or you will get at least 5 points off.

5 Alternative extra credit for quiz  Design a 10-question quiz related to the subject, in the quiz that you want to increase your score. Put a “correct” answer for each question.  Put your quiz & solution on your webpage  Your base score will be 8 points. If your quiz is good, you will get 9 or 10. If it is bad you will get 0-7 points

6 Extra credit submission  You have to state what each extra credit is for, e.g. for quiz#4, asg#12, etc.  Normal 5-page summary extra credits  Print out and hand them to me  Alternative extra credits  Put on your webpage (and notify me)  You can start submitting your extra credit when we start “ethics for computer science” part  You have to submit your extra credit before the final exam

7 Program translation  Today lecture  Binary representation & machine language

8 Binary representation & machine language  Human language  “hello my name is yashas”  Machine language  “0001 1000 1111 1100 ………………0101”  Machine language has only 0 and 1

9 How machine language work? Human: add one and two Machine: Code for ADD12 12912 1000 00010000 00010000 0010

10 Binary representation  Machine only understands 0 and 1  We need to convert numbers that we understand to what machines understand (and vise versa) 00000 10001 20010 30011 40100 50101 60110 70111 81000 91001 101010 111011 121100 131101 141110 151111

11 How to adds two numbers in binary representation? 0001 0001 + 0010 0010 + 0100 00000 10001 20010 30011 40100 50101 60110 70111 0000 0010 + 0010 0011 0010 + 0101 0011 0011 + 0110 0101 0011 + 1000 8 91001 101010 111011 121100 131101 141110 151111 What can you notice here? 16 10000

12 Binary representation – power of two bits 00000 10001 20010 40100 81000 1610000 32100000 641000000 12810000000 00000 10000 0001 20000 0010 40000 0100 80000 1000 160001 0000 320010 0000 640100 0000 1281000 0000

13 Binary representation – power of two bits 00000 10000 0001 20000 0010 40000 0100 80000 1000 160001 0000 320010 0000 640100 0000 1281000 0000 0010 0010 + 0100 0100 + 1000 01000 01000 + 10000 1100 0000 = 1000 0000 + 0100 000 = 128 + 64 = 192

14 How to convert binary number to decimal number? 10110011 10110011 1286432168421 128321621 = 179 = 128 + 32 + 16 + 2 + 1 =179

15 How to convert decimal number to binary number? 198 = ? 198 = 128 + 70 = 128 + 64 + 6 = 128 + 64 + 4 + 2 = 11000110 1286432168421 11000110

16 Hexadecimal representation DecimalBinaryHex 000000 100011 200102 300113 401004 501015 601106 701117 DecimalBinaryHex 810008 910019 101010A 111011B 121100C 131101D 141110E 151111F

17 How to convert binary to hexadecimal (and vise versa)? 0001 0010 1111 1100 = 12FC 101111 = 0010 1111 = 2F 10 0011 1100 = 0010 0011 1100 = 23C 1001 1101 11 = 0010 0111 0111 = 277 2F = 0010 1111 6CA3 = 0110 1100 1010 0011

18 Hexadecimal representation  Computer doesn’t understand it  Save people a lot of writing  Easier for people to understand  0, 1, 2, …………, 9, A, B, C, D, E, F

19 Coverting Hex to Decimal and vise versta  Hex to Dec: Hex  Binary  Decimal  Dec to Hex: Dec  Binary  Hex

20 What you need to know (well)  How to convert binary to decimal  How to convert decimal to binary  How to convert binary to hexadecimal  How to convert hexadecimal to binary  How to add numbers in binary form


Download ppt "COP3502: Introduction to Computer Science Yashas Shankar Program Translation."

Similar presentations


Ads by Google