Lec1 - Introduction To Computers, Programs, and C++
Lec1 - Introduction To Computers, Programs, and C++
• Data
‒ In computing, data is the information that has been translated into
a form that is efficient for movement or processing
• Computer Consists of
‒ Hardware
‒ Software
• Keyboard
• Mouse
• What else??
3
CS-114 Fundamentals of Programming
Hardware Components
• Central processing unit
• Memory
• Storage devices
• Input devices
• Output devices
• Communication devices
Programming Language
Insertion sort algorithm
Operating System
1. Find minimum number in input array
Instruction Set 2. Move minimum number into output array
Architecture 3. Repeat steps 1 and 2 until finished
Microarchitecture
C implementation of insertion sort
Register-Transfer void isort( int b[], int a[], int n ) {
Level Gate Level for ( int idx, k = 0; k < n; k++ ) {
Circuits int min = 100;
for ( int i = 0; i < n; i++ ) {
Devices if ( a[i] < min ) {
Technology min = a[i];
idx = i;
}
}
b[k] = min;
a[idx] = 100;
}
}
Programming Language
Operating System
Instruction Set
Architecture
Microarchitecture MIPS32 Instruction Set
Register-Transfer Instructions that machine executes
Level Gate Level ble $a2, done
Circuits z $a7, $zero
mov
Devices e
Technology li $t4, 99
move $a4, $a1
move $v1, $zero
li $a3, 99
lw $a5, 0($a4)
addiu $a4, $a4, 4
slt $a6, $a5, $a3
movn $v0, $v1, $a6
addiu $v1, $v1, 1
movn $a3, $a5, $a6
Application
How data flows
Algorithm through system
Computer Engineering
Programming Language
Operating System
Instruction Set Boolean logic gates
Architecture and functions
Microarchitecture
Register-Transfer Combining devices
Level Gate Level to do useful work
Circuits
Devices Transistors and wires
Technology
Si Si Si
Silicon process
technology Si Si Si
Application
Algorithm Traditional
Computer Science
Computer Engineering
Programming Language
Operating System
Instruction Set Computer Engineering is at the
Architecture interface between hardware and software
Microarchitecture and considers the entire system
Register-Transfer
Level Gate Level Traditional
Circuits Electrical Engineering
Devices
Technology
Programming Language
Operating System
Instruction Set
Architecture
Microarchitecture
Register-Transfer
Level Gate Level Lab
Circuits Hardware pushing
Devices towards software
Technology (EE,CE)
Application
Algorithm Application Requirements
• Suggest how to improve architecture
Computer Engineering
Programming Language
Operating System • Provide revenue to fund development
Instruction Set
Architecture Computer engineers provide feedback to guide
application and technology research directions
Microarchitecture
Register-Transfer
Level Gate Level Technology Constraints
Circuits • Restrict what can be done efficiently
Devices • New technologies make new arch possible
Technology
Application
Algorithm
Processor Compute
Computer Engineering
Programming Language
data
Operating System
Instruction Set
Architecture Input Output Move
Data Network Data data
Microarchitecture
Register-Transfer
Level Gate Level Memory Store
data
Circuits
Devices
Technology
• Outputs:
‒ A cup of tea
‒ Algorithm:
• Boil Water:
‒ Place a kettle or pot with water on a heat source (e.g., stove).
‒ Turn on the heat source and wait for the water to come to a rolling boil. This is the "precondition" for making tea.
• Optional Additives:
‒ If desired, add sugar, milk, honey, or any other preferred additives to the tea. Stir well to ensure they are mixed.
• Enjoy:
‒ Your cup of tea is ready to be enjoyed. Be sure to allow it to cool to a suitable drinking temperature before sipping.
• Safety Note:
‒ Be cautious when handling hot water and hot tea. Avoid burns by using appropriate tools and being mindful of the
temperature.