Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Programming AP Computer Science. Computers What is a computer? –CPU –ALU –Memory –Hard Drive.

Similar presentations


Presentation on theme: "Introduction to Programming AP Computer Science. Computers What is a computer? –CPU –ALU –Memory –Hard Drive."— Presentation transcript:

1 Introduction to Programming AP Computer Science

2 Computers What is a computer? –CPU –ALU –Memory –Hard Drive

3 CPU Central Processing Unit –Traffic Cop of data –Decision maker If this then do that

4 ALU Arithmetic Logic Unit –Completes all math calculations –Math comparisons –Is part of CPU today

5 Memory RAM – Random Access Memory –Temporary storage of data –Very fast –When the computer is off RAM is empty.

6 Hard Drive Permanent storage of data. –Large capacity –Slow –Called virtual memory When memory (RAM) runs out, the computer uses the hard drive. –This slows down performance.

7 What Can a Computer Do? 1.Store Data (Memory & HD) –Temporarily and permanently. 2.Move Data from on location to another. (CPU) –To a printer, screen, internet, within its own memory, etc. 3.Perform Mathematical Calculations (ALU).

8 What Can a Computer Do? Every program is a trick of these three instructions… 1.Store data 2.Move data 3.Perform mathematical operations on data.

9 Skills You Will Need… Math

10 Skills You Will Need… Visualization of Data

11 Skills You Will Need… Algorithm Development –Breaking a complex solution up into single pieces called instructions.

12 Binary A sequence of 1’s and 0’s A.K.A. machine language –The only language a computer understands.

13 Decimal 578 5 hundred, seventy eight 5 hundreds 7 tens 8 ones

14 Decimal 578 10 0 10 1 10 2 5 x 10 2 = 7 x 10 1 = 8 x 10 0 = 500 70 8 578 Deca = 10. Base 10 number system.

15 Binary Computers cannot represent things with 10 different states. Computers have two basic states: –On/Off –True/False –1/0

16 Binary 10010 Bi = 2. Base 2 number system. What number is this?

17 Binary 1 0 0 1 0 Bi = 2. Base 2 number system. 2020 21212 2323 2424 1 x 2 4 = 0 x 2 3 = 0 x 2 2 = 1 x 2 1 = 0 x 2 0 = 16 0 0 2 0 18 Base 10

18 Binary 1 1 0 0 1 Bi = 2. Base 2 number system. 1 24 8 16 8 1 25 Base 10

19 Binary What is 55 (base 10) in binary? 1248163264 55 1 - 32= 23 1 - 16= 3 1 - 4= 7 1 1 - 3 = 0 00 00110111 Leave answer in 8 bits or multiple of 4.

20 Practice 1.100 (base 10) to binary. 2.70 (base 10) to binary. 3.100011 (base 2) to decimal. 4.1001101 (base 2) to decimal.

21 Hexadecimal Hexa = 6, Deca = 10. Base 16 number system. 0 1 2 3 4 5 6 7 8 9 A = 10 B = 11 C = 12 D = 13 E = 14 F = 15

22 Hexadecimal Hexa = 6, Deca = 10. Base 16 number system. Used because binary can be too cumbersome. Easily convert from binary to hexadecimal and back.

23 Binary to Hexadecimal Hexa = 6, Deca = 10. Base 16 number system. 111001101010 STEP 1: Group them into four bits from right to left. STEP 2: Independently convert each 4 bits. 14 6 10 STEP 3: Convert using Hexadecimal chart and recombine. E6A

24 Hexadecimal to Binary Hexa = 6, Deca = 10. Base 16 number system. B07 STEP 1: Separate all digits. STEP 2: Convert each digit to 4 bits binary individually. 1011 00000111 STEP 3: recombine.

25 Practice 1.1000 1110 0101 2 to hexadecimal 2.0011 1111 1101 2 to hexadecimal 3.FAD 16 to binary 4.70 16 to binary Challenge 1. 30 16 to decimal. 2. 320 10 to hexadecimal.

26 Mayan Number System Base 20.

27 Data Concepts How does the computer store letters, symbols, colors, etc.?

28 Letters and Simple Symbols ASCII – The American Standard Code for Information Interchange.

29 Colors RGB – Red Green Blue RGBA – Red Green Blue Alpha

30 Programming Languages Binary –We started programming in binary. It was a long difficult process.

31 Assembly Language Simple English-like abbreviations for commonly understood binary instructions.

32 Assembly Language Problem is…..the computer only speaks binary. This assembly language program must be converted into binary. A process achieved through an assembler.

33 Assembly Language

34 High-Level Languages Uses everyday English and math notation to instruct the computer. Not directly understood by computers. –Needs to be compiled. The process of converting the code into binary.

35 High-Level Languages Java C++ Python PHP JavaScript Perl Fortran

36 Java High-Level Language Not strictly compiled –Interpreted language Write once, run everywhere Not machine dependent like C++

37 Interpreted Language ________ ________ _______ Java Source Code.java Java “Compiler” (Windows) Java “Compiler” (Windows) Java “Compiler” (Mac) Java “Compiler” (Mac) Java “Compiler” (Linux) Java “Compiler” (Linux).class Java Interpreter (Windows) Java ByteCode— platform independent Java Interpreter (Mac) Java Interpreter (Linux) JVM Java Virtual machine JDK Java Development Kit

38 Java API API: Application Programming Interface. A group of built in libraries that you can use, extend, incorporate into your code.

39 In Order To Program… JDK (Java Development Kit) Eclipse –A free IDE (Integrated Development Environment).


Download ppt "Introduction to Programming AP Computer Science. Computers What is a computer? –CPU –ALU –Memory –Hard Drive."

Similar presentations


Ads by Google