Chapter 1: Introduction to Computers and Programming Flashcards
A set of instructions that a computer follows to perform a task. Commonly known as Software.
Program
A person who can design, create, and test computer programs. Also known as a software developer.
Programmer
The physical devices that make up a computer
Hardware
The part of the computer that actually runs program
Central Processing Unit (CPU)
CPUs located in small chips
Microprocessors
Where the computer stores a program while program is running, and data used by program
Main Memory
also called RAM
-CPU is able to quickly access data in RAM
-Volatile memory used for temporary storage while program is running
-Contents are erased when computer is off
Can hold data for long periods of time
Secondary Storage
Types of secondary memory:
Disk drive: magnetically encodes data onto a spinning circular disk
Solid state drive: faster than disk drive, no moving parts, stores data in solid state memory
Flash memory: portable, no physical disk
Data the computer collects from people and other devices
Input
Component that collects the data
Input devices
Ex: keyboard, mouse, touchscreen, scanner, camera
Disk drives can be considered input devices because they load programs into the main memory
Data produced by the computer for other people or devices
Output
Ex: video display, printer
Disk drives and USB drives can be considered output devices because data is sent to them to be saved
Everything the computer does is controlled by what?
Software
General categories:
Application software
System software
Programs that make computer useful for every day tasks
Application software
Ex: word processing, email, games, and Web browsers
Programs that control and manage basic operations of a computer
-Operating system: controls operations of hardware components
-Utility program: performs specific task to enhance computer operation or safeguard data
-Software development tools: used to create, modify, and test software programs
System software
How is all computer data stored?
In sequences of 0s and 1s
Just enough memory to store letter or small numbers
-divided into eight bits
-The on/off pattern of bits in a byte represents data stored in the byte
Byte
Electrical component that can hold positive or negative charge, like on/off switch
Bit
What two values does bit represent?
0 and 1
What numbering system do computers use?
Binary
What are the Byte size limits?
0 and 255
0= all bits off
255= all bits on
-To store larger number, use several bytes
What is the smallest no-negative number you can store in 1 byte?
0
What is the largest number you can store in 1 byte?
255
How must data be stored in computers?
Data must be stored as binary number
How are characters stored?
Characters are converted to numeric code, numeric code is stored in memory
What is the most important coding scheme?
ASCII
ASCII is limited: defines codes for only 128 characters
Compatible with ASCII and can represent characters for other languages
Unicode coding
How do computers store negative and real numbers?
The computer uses binary numbering and encoding schemes
How are negative numbers encoded?
Using twos complement
How are real numbers encoded?
Using floating-point notation
Describes any device that stores data as binary numbers
Digital
How are digital images composed?
They are composed of pixels
-To store images, each pixel is converted to a binary number representing the pixels color
How is digital music composed?
It is composed of sections called samples
-To store music, each sample is converted to a binary number
What is the CPU program cycle?
Fetch, decode, execute
- Fetch: read the next instruction from the memory into CPU
- Decode: CPU decodes fetched instruction to determine which operation to perform
- Execute: perform the operation
Uses short words (mnemonics) for instructions instead of binary numbers. Easier for programmers to work with.
Assembly language
Translates assembly language to machine language for execution by CPU
Assembler
Close in nature to machine language
Ex: assembly language
Low-level language
Allows simple creation of powerful and complex programs
-no need to know how CPU works or write large number of instructions
-more intuitive to understand
High-level language
Predefined words used to write program in high-level language
-each keyword has specific meaning
Keywords
Perform operations on data
Ex: math operators to perform arithmetic
Operators
Set of rules to be followed when writing program
Syntax
Individual instruction used in high-level language
Statement
Translates high-level language program into separate machine language program
Compiler
Translates and executes instructions in high-level language program
Interpreter
Statements (code) written by programmer
Source code
Prevents code from being translated
syntax error
-Single program that provides tools to write, execute and test a program
-Runs in interactive mode
-Has built-in test editor with features designed to help write Python programs
Integrated Development and Learning Environment (IDLE)