Lecture1

so in the binary number system we shall write 1 0 1 0

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 02 101 100 5 + 70 + 300+ 9000 = 9375 using the digits {0,1,2,3,4,5,6,7,8,9} and powers of 10... ❖ So in the binary number system, we shall write: * 1 0 1 0 20 23 22 21 0 + 2 + 0 + 8 = 10 using the binary digits {0,1} and powers of 2. Lecture Unit 1 ECE15: Introduction to Computer Programming Using the C Language 12 Conversion from Decimal to Binary ❖ What is decimal 10 in binary? 001010 25 24 23 22 21 20 ❖ The same answer, using a different method: quotient 0 div:2 quotient 1 div:2 quotient 2 div:2 quotient 5 div:2 remainder 10 remainder remainder remainder 010 1010 Lecture Unit 1 ECE15: Introduction to Computer Programming Using the C Language 13 Outline of this Lecture ❖ Computer hardware -- overview ❖ Computer Software -- Over view ❖ Our very first C programs ❖ Some relevant history Lecture Unit 1 ECE15: Introduction to Computer Programming Using the C Language 14 What’s Software and How Does It Work? ❖ Software is a program or a collection of programs. Each program is a sequence of instructions to the computer, designed to perform a specific task. ❖ At run-time, the program’s instructions are downloaded into the main memory (RAM) of the computer. ❖ The CPU circuits are hard-wired to do the following: fetch instructions one-by-one from the main memory, decode them, and execute them. ❖ The instructions are executed sequentially, one-by-one, with one exception: certain instructions are branching instructions, which make the CPU jump to a specific address in the main memory and resume execution. Lecture Unit 1 ECE15: Introduction to Computer Programming Using the C Language 15 Software: Machine Language ❖ Machine language is the only language that the CPU really understands. It is different for different CPUs. ❖ Machine language is a set of binary strings that code for elementary CPU instructions, such as: ‣ Data transfer between registers and RAM ‣ Comparisons and conditional branching ‣ Simple arithmetic and logic operations ❖ Here is an example: 0100 000001 000010 move from R1 to R2 Lecture Unit 1 ECE15: Introduction to Computer Programming Using the C Language 16 Software: Assembly Language ❖ The Assembly language is a symbolic representation of the binary machine language, for example: mov mov mov mov add mov add...
View Full Document

Ask a homework question - tutors are online