WK02 - 14:440:127 INTRODUCTION TO COMPUTERS FOR ENGINEERS...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
INTRODUCTION TO COMPUTERS FOR ENGINEERS 14:440:127
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Basic Computer + - * / CPU 0 1 2 Memory contents 3 4 5 7 6 8 9 Registers Closer to CPU
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Assembly Language Mov 0,20 #Move 20 into register - 0 Mov 1,30 #Move 30 into register 1 Add 0,1,2 #Add contents of register 0 and 1 and store the result in register 2 There are set of instructions that the chipset supports and your program should essentially use those instructions Tough to program! All operations have to be done through mov, add, sub and other primitive instructions
Background image of page 4
C,C++ #include<iostream> using namespace std; int main() { 20+30; return 0; }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Hello World C++ programs have something called an entry point main() function. So things inside this function gets executed first. #include<iostream> using namespace std; int main() { cout <<“Hello World \ n”; return 0; }
Background image of page 6
Hello World cout Print messages to console. Already implemented in iostream. So I include iostream in the first line. Instead of writing my own code to print messages to screen I can use cout. #include
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

WK02 - 14:440:127 INTRODUCTION TO COMPUTERS FOR ENGINEERS...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online