Summary

This document is a lecture on fundamentals of programming. It covers topics like how to maximize the benefit of CSC111 and being a good programmer. The document also includes learning objectives for the course.

Full Transcript

Fundamentals of Programming Course coordinator and instructor : Dr. Mustafa Understanding Computers: Today and Tomorrow, 13th Edition How To Maximize your Benefit of CSC111 ? Come to every lecture/lab. Solve al...

Fundamentals of Programming Course coordinator and instructor : Dr. Mustafa Understanding Computers: Today and Tomorrow, 13th Edition How To Maximize your Benefit of CSC111 ? Come to every lecture/lab. Solve all the sheets yourself during the lab. Participate in the online learning resources (hackerrank, datacamp, geeksforgeeks, w3school, etc) Practice writing a lot of programs. – Work independently. – Turn in assignments on time. – Form teams and work in large projects (idea of a future startup). Understanding Computers: Today and Tomorrow, 13th Edition How To be Good Programmer ? Learn/practice/test/debug/innovate. Foundation Comes First There is no such thing as “Gifted Programmer”, You need to work hard. Understanding Computers: Today and Tomorrow, 13th Edition Lecture 1 Chapter 1: Introduction to the World of Computers Source: Understanding computers: today & tomorrow Understanding Computers: Today and Tomorrow, 13th Edition Learning Objectives 1. Explain why it is essential to learn about computers today and discuss several ways computers are integrated into our business and personal lives. 2. Define a computer and describe its primary operations. 3. List some important milestones in computer evolution. 4. Identify the major parts of a personal computer, including input, processing, output, storage, and communications hardware. 5. Define software and understand how it is used to instruct the computer what to do. 7 Understanding Computers: Today and Tomorrow, 13th Edition Learning Objectives 6. List the six basic types of computers, giving at least one example of each type of computer and stating what that computer might be used for. 7. Explain what a network, the Internet, and the World Wide Web are, as well as how computers, people, and Web pages are identified on the Internet. 8. Describe how to access a Web page and navigate through a Web site. 9. Discuss the societal impact of computers, including some benefits and risks related to their prominence in our society. Understanding Computers: Today and Tomorrow, 13th Edition Computers in the Home Computers used for a variety of tasks: – Looking up information and news – Exchanging e-mail – Shopping and paying bills – Watching TV and videos – Downloading music and movies – Organizing digital photographs – Playing games – Telecommuting 9 Understanding Computers: Today and Tomorrow, 13th Edition Computers in the Home Convergence – The computer has become the central part of home entertainment Wireless networking – Computers can be used in nearly any location Smart appliances – Traditional appliances with built-in computer or communication technology Smart homes – Household tasks are monitored and controlled by a main computer in the house 10 Understanding Computers: Today and Tomorrow, 13th Edition Computers in Education Many students today have access to computers either in a classroom or a computer lab Colleges and universities are even more integrated – Wireless hotspots allow usage of personal laptops to connect to the college network – Some colleges require a computer for enrollment Distance learning – Students participate from locations other than the traditional classroom setting using computers and Internet access 11 Understanding Computers: Today and Tomorrow, 13th Edition Computers on the Job Computers have become a universal on-the-job tool for decision-making, productivity, and communication – Used by all types of employees – Used for access control and other security measures – Use by service professionals is growing – Used extensively by the military – Employees in all lines of work need to continually refresh their computer skills 12 Understanding Computers: Today and Tomorrow, 13th Edition Computers on the Go Computers are encountered in nearly every aspect of daily life – Consumer kiosks – ATM transactions – POS systems at retail stores – Self-checkout systems – Portable computers or mobile devices – M-commerce systems – GPS systems 13 Understanding Computers: Today and Tomorrow, 13th Edition What Is a Computer and What Does It Do? Computer: A programmable, electronic device that accepts data, performs operations on that data, and stores the data or results as needed – Computers follow instructions, called programs, which determine the tasks the computer will perform Basic operations – Input: Entering data into the computer – Processing: Performing operations on the data – Output: Presenting the results – Storage: Saving data, programs, or output for future use – Communications: Sending or receiving data 14 Understanding Computers: Today and Tomorrow, 13th Edition What Is a Computer and What Does It Do? 15 Understanding Computers: Today and Tomorrow, 13th Edition Data vs. Information Data – Raw, unorganized facts – Can be in the form of text, graphics, audio, or video Information – Data that has been processed into a meaningful form Information processing – Converting data into information 16 Understanding Computers: Today and Tomorrow, 13th Edition Hardware Hardware: The physical parts of a computer – Internal hardware Located inside the main box (system unit) of the computer – External hardware Located outside the system unit Connect to the computer via a wired or wireless connection – There is hardware associated with all five computer operations 17 Understanding Computers: Today and Tomorrow, 13th Edition Hardware 18 Understanding Computers: Today and Tomorrow, 13th Edition Hardware Input devices – Used to input data into the computer – Keyboards, mice, scanners, cameras, microphones, joysticks, touch pads, touch screens, fingerprint readers, etc. Processing devices – Perform calculations and control computer’s operation – Central processing unit (CPU) and memory Output devices – Present results to the user – Monitors, printers, speakers, projectors, etc. 19 Understanding Computers: Today and Tomorrow, 13th Edition Hardware Storage devices – Used to store data on or access data from storage media – Hard drives, CD/DVD discs and drives, USB flash drives, etc. Communications devices – Allow users to communicate with others and to electronically access remote information – Modems, network adapters, etc. 20 Understanding Computers: Today and Tomorrow, 13th Edition Hardware 21 Understanding Computers: Today and Tomorrow, 13th Edition Software Software: The programs or instructions used to tell the computer hardware what to do – System software: Operating system starts up the computer and controls its operation Without OS computer cannot function Boots the computer and launches programs at the user’s direction Most use a GUI to interact with the user via windows, icons, menus, buttons, etc. Windows, Mac OS, Linux, etc. 22 Understanding Computers: Today and Tomorrow, 13th Edition Software 23 Understanding Computers: Today and Tomorrow, 13th Edition Application Software – Application software: Performs specific tasks or applications Creating letters, budgets, etc. Managing inventory and customer databases Editing photographs Scheduling appointments Viewing Web pages Sending and receiving e-mail Recording / playing CDs/DVDs Designing homes Playing games 24 Understanding Computers: Today and Tomorrow, 13th Edition Computer Users and Professionals Computer users (end users): People who use a computer to obtain information Computer professionals include: – Programmers – Systems analysts – Computer operations personnel – Security specialists 25 Understanding Computers: Today and Tomorrow, 13th Edition Computers to Fit Every Need Six basic categories of computers: – Embedded computers – Mobile devices – Personal computers – Midrange servers – Mainframe computers – Supercomputers 26 Understanding Computers: Today and Tomorrow, 13th Edition Embedded Computers Embedded computer: Embedded into a product and designed to perform specific tasks or functions for that product Cannot be used as general-purpose computers Often embedded into: – Household appliances – Thermostats – Sewing machines – A/V equipment – Cars 27 Understanding Computers: Today and Tomorrow, 13th Edition Mobile Devices Mobile device: A very small device with some type of built-in computing or Internet capability Typically based on mobile phones Typically have small screens and keyboards Examples: – Smartphones – Handheld gaming devices – Portable digital media players 28 Understanding Computers: Today and Tomorrow, 13th Edition Personal Computers (PCs) Personal computer: A small computer designed to be used by one person at a time – Also called a microcomputer – Range in size from desktop computers to UMPC’s Desktop computers: Fit on or next to a desk – Can use tower case, desktop case, or all-in-one – Can be PC- compatible or Macintosh – Not designed to be portable 29 Understanding Computers: Today and Tomorrow, 13th Edition Portable Computers Notebook (laptop) computers: Typically use clamshell design Tablet computers: Can be slate tablets or convertible tablets Netbooks: Small notebooks; rapidly growing type of PC Ultra-mobile PCs (UMPCs): Handheld computers 30 Understanding Computers: Today and Tomorrow, 13th Edition Thin Clients and Internet Appliances Thin client or network computer (NC): Device designed to access a network for processing and data storage – Lower cost, increased security and easier maintenance – Limited or no local storage – Not able to function as a computer if network is down Internet appliance: Specialized network computer designed for Internet access and/or e-mail exchange – Often set-top boxes – Can include Internet-enabled gaming consoles 31 Understanding Computers: Today and Tomorrow, 13th Edition Thin Clients and Internet Appliances 32 Understanding Computers: Today and Tomorrow, 13th Edition Midrange Servers Midrange server: A medium-sized computer used to host programs and data for a small network – Users connect via a network with a computer, thin client, or dumb terminal – May consist of a collection of individual circuit boards called blades – Virtualization: Creating virtual environments (often used to share a server for increased efficiency) 33 Understanding Computers: Today and Tomorrow, 13th Edition Mainframe Computers Mainframe computer: Powerful computer used by several large organizations to manage large amounts of centralized data – Standard choice for large organizations, hospitals, universities, large businesses, banks, government offices – Located in climate-controlled data centers and connected to the rest of the company computers via a network – Larger, more expensive, and more powerful than midrange servers – Usually operate 24 hours a day – Also called high-end servers or enterprise-class servers 34 Understanding Computers: Today and Tomorrow, 13th Edition Mainframe Computers 35 Understanding Computers: Today and Tomorrow, 13th Edition Supercomputers Supercomputer: Fastest, most expensive, most powerful type of computer – Generally run one program at a time, as fast as possible – Commonly built by connecting hundreds of smaller computers, supercomputing cluster – Used for space exploration, missile guidance, satellites, weather forecast, oil exploration, scientific research, complex Web sites, decision support systems, 3D applications, etc. 36 Understanding Computers: Today and Tomorrow, 13th Edition Supercomputers 37 Understanding Computers: Today and Tomorrow, 13th Edition Computer Networks and the Internet Computer network: A collection of hardware and other devices that are connected together. – Users can share hardware, software, and data – Users can communicate with each other Network servers: Manage resources on a network Clients: Access resources through the network server Computer networks exist in many sizes and types – Home networks – School and small business networks – Large corporate – Public wireless networks – The Internet 38 Understanding Computers: Today and Tomorrow, 13th Edition Lecture 1 Chapter 2 The System Unit: Processing and Memory Source: Understanding computers: today & tomorrow Understanding Computers: Today and Tomorrow, 13th Edition Learning Objectives 1. Understand how data and programs are represented to a computer and be able to identify a few of the coding systems used to accomplish this. 2. Explain the functions of the hardware components commonly found inside the system unit, such as the CPU, memory, buses, and expansion cards. 3. Describe how new peripheral devices or other hardware can be added to a computer. 4. Understand how the computer system’s CPU and memory components process program instructions and data. 5. Name and evaluate several strategies that can be used today for speeding up the operations of a computer. 6. List some technologies that may be used in the future computers. 40 Understanding Computers: Today and Tomorrow, 13th Edition Overview This chapter covers: – How computers represent data and program instructions – How the CPU, memory, and other components located inside the system unit are arranged, as well as the characteristics of the components – How the CPU performs processing tasks – Strategies to speed up a computer today and to create faster computers in the future 41 Understanding Computers: Today and Tomorrow, 13th Edition Data and Program Representation In order to be understood by a computer, data and programs need to be represented appropriately Coding systems: Used to represent data and programs in a manner understood by the computer Digital computers: Can only understand two states, off and on (0 and 1) Digital data representation: The process of representing data in digital form so it can be understood by a computer 42 Understanding Computers: Today and Tomorrow, 13th Edition Digital Data Representation Bit: The smallest unit of data that a binary computer can recognize (a single 1 or 0) Byte = 8 bits Byte terminology used to express the size of documents and other files, programs, etc. Prefixes are often used to express larger quantities of bytes: kilobyte (KB), megabyte (MB), gigabyte (GB), terabyte (TB), etc. 43 Understanding Computers: Today and Tomorrow, 13th Edition The Binary Numbering System Numbering system: A way of representing numbers Decimal numbering system – Uses 10 symbols (0-9) Binary numbering system – Uses only two symbols (1 and 0) to represent all possible numbers In both systems, the position of the digits determines the power to which the base number (such as 10 or 2) is raised 44 Understanding Computers: Today and Tomorrow, 13th Edition The Binary Numbering System 45 Understanding Computers: Today and Tomorrow, 13th Edition Coding Systems for Text-Based Data ASCII and EBCDIC – ASCII (American Standard Code for Information Interchange): coding system traditionally used with personal computers – EBCDIC (Extended Binary-Coded Decimal Interchange Code): developed by IBM, primarily for mainframe use 46 Understanding Computers: Today and Tomorrow, 13th Edition Coding Systems for Text-Based Data Unicode: newer code (32 bits per character is common); universal coding standard designed to represent text-based data written in any ancient or modern language Replacing ASCII as the primary text-coding system 47 Understanding Computers: Today and Tomorrow, 13th Edition Representing Programs: Machine Language Machine language: Binary-based language for representing computer programs the computer can execute directly – Early programs were written in machine language. – Today’s programs still need to be translated into machine language in order to be understood by the computer Most programs are written in other programming languages – Language translators are used to translate the programs into machine language 48 Understanding Computers: Today and Tomorrow, 13th Edition Inside the System Unit System unit: The main case of a computer – Houses the processing hardware for a computer – Also contains storage devices, the power supply, and cooling fans – Houses the CPU, memory, interfaces to connect to peripheral devices (printers, etc), and other components such as CD/DVD drives – With a desktop computer, usually looks like a rectangular box 49 Understanding Computers: Today and Tomorrow, 13th Edition Inside the System Unit 50 Understanding Computers: Today and Tomorrow, 13th Edition The Motherboard Computer chip: A very small pieces of silicon or other semi-conducting material onto which integrated circuits are embedded Circuit board: A thin board containing computer chips and other electronic components Motherboard or system board: The main circuit board inside the system unit – All devices must connect to the motherboard – External devices (monitors, keyboards, mice, printers) typically connect by plugging into a port exposed through the exterior of the system unit – Wireless devices connect through a transceiver or wireless networking technology (like Bluetooth) 51 Understanding Computers: Today and Tomorrow, 13th Edition The CPU Central processing unit (CPU): circuitry and components packaged together and connected directly to the motherboard – Does the vast majority of processing for a computer – Also called a processor; called a microprocessor when talking about personal computesr Dual-core CPU: Contains the processing components (cores) of two separate processors on a single CPU Quad-core CPU: Contains 4 cores Typically different CPUs for desktop computers, portable computers, servers, mobile devices, consumer devices, etc. Often made by Intel or AMD 52 Understanding Computers: Today and Tomorrow, 13th Edition The CPU 53 Understanding Computers: Today and Tomorrow, 13th Edition The CPU 54 Understanding Computers: Today and Tomorrow, 13th Edition Processing Speed CPU clock speed: One measurement of processing speed – Measured in megahertz (MHz) or gigahertz (GHz) – Higher CPU clock speed = more instructions processed per second Alternate measure of processing speed is the number of instructions a CPU can process per second – Megaflops, gigaflops, teraflops Other factors (CPU architecture, memory, bus speed, amount of RAM, etc.) also affect the overall processing speed of a computer Benchmark tests: Can be used to evaluate overall processing speed 55 Understanding Computers: Today and Tomorrow, 13th Edition Bus Width, Bus Speed, and Bandwidth Bus: An electronic path over which data can travel Bus width: The number of wires in the bus over which data can travel Bus width and speed determine the throughput (or bandwidth) of the bus – The amount of data that can be transferred by the bus in a given time period 56 Understanding Computers: Today and Tomorrow, 13th Edition Memory Memory refers to chip based storage RAM (random access memory): Computer’s main memory – Consists of chips arrange on a circuit board called a memory module plugged into the motherboard – Stores essential parts of operating system, programs, and data the computer is currently using – Adequate RAM is needed to run programs – Volatile: Contents of RAM is lost when the computer is shut off – Most personal computers use SD-RAM – MRAM and PRAM: non-volatile RAM under development 57 Understanding Computers: Today and Tomorrow, 13th Edition Memory 58 Understanding Computers: Today and Tomorrow, 13th Edition Memory Registers: High-speed memory built into the CPU; used by the CPU ROM (read-only memory): Non-volatile chips located on the motherboard into which data or programs have been permanently stored – Retrieved by the computer when needed – Being replaced with flash memory for firmware Flash memory: Type of nonvolatile memory that can be erased and reprogrammed – Some flash memory chips are used by the computer – Flash memory chips are also used in flash memory storage media (sticks, cards, and drives) 59 Understanding Computers: Today and Tomorrow, 13th Edition Fans, Heat Sinks, and Other Cooling Components Heat: A continuing problem for CPU and computer manufacturers Fans: Used on most personal computers Heat sinks: Small components typically made out of aluminum with fins that help to dissipate heat Water cooling systems: Cool the computer with liquid-filed tubes Notebook cooling stands Other cooling methods (such as ion pump cooling systems) are under development 60 Understanding Computers: Today and Tomorrow, 13th Edition Fans, Heat Sinks, and Other Cooling Components 61 Understanding Computers: Today and Tomorrow, 13th Edition Expansion Slots, Expansion Cards, and ExpressCards Expansion slot: A location on the motherboard into which expansion cards are inserted Expansion card: A circuit board used to add additional functionality or to attach a peripheral device ExpressCard modules: Designed for notebook computer expansion 62 Understanding Computers: Today and Tomorrow, 13th Edition Buses Bus: An electronic path within a computer over which data travels – Expansion bus: Connects the CPU to peripheral (typically input and output) devices – Memory bus: connects CPU directly to RAM – Frontside bus: connects CPU to I/O bridge – PCI and PCI Express (PCIe) bus – Universal Serial Bus (USB) – FireWire/IEEE 1394 bus 63 Understanding Computers: Today and Tomorrow, 13th Edition Buses 64 Understanding Computers: Today and Tomorrow, 13th Edition Ports and Connectors Port: A connector on the exterior of a computer’s system unit to which a device may be attached – SCSI – Monitor (VGA, – MIDI DVI, HDMI) – IrDA – Network – Flash memory card – Modem slots – USB – Game – FireWire – Audio – Keyboard – eSATA 65 Understanding Computers: Today and Tomorrow, 13th Edition Ports and Connectors 66 Understanding Computers: Today and Tomorrow, 13th Edition Ports and Connectors Many desktop computers come with a variety of ports on the front of the system unit for easy access A wired or wireless hub can connect many devices to a single USB or FireWire port 67 Understanding Computers: Today and Tomorrow, 13th Edition Ports and Connectors Notebook and netbook computers have ports similar to desktop computers, but often not as many UMPCs and mobile devices typically have less ports – An SD slot is common for both memory cards and to connect peripheral devices 68 Understanding Computers: Today and Tomorrow, 13th Edition How the CPU Works CPU: Consists of a variety of circuitry and components packaged together – Transistor: Key element of the microprocessor Made of semi-conductor material that acts like a switch controlling the flow of electrons inside a chip Today’s CPUs contain hundreds of millions of transistors; the number doubles about every 18 months (Moore’s Law) 69 Understanding Computers: Today and Tomorrow, 13th Edition Typical CPU Components Arithmetic/Logic Unit (ALU): Performs integer arithmetic and logical operations Floating Point Unit (FPU): Performs decimal arithmetic Control unit: Coordinates and controls activities Prefetch unit: Tries to fetch data and instructions before they are needed from cache or RAM Decode unit: Translates instructions so they are understood by the control unit, ALU, and FPU Internal cache and registers: Store data and instructions needed by the CPU Bus interface unit: Allows the core to communicate with other CPU components 70 Understanding Computers: Today and Tomorrow, 13th Edition Typical CPU Components 71 Understanding Computers: Today and Tomorrow, 13th Edition The System Clock and the Machine Cycle Machine cycle: The series of operations involved in the execution of a single machine level instruction – Fetch: The program instruction is fetched – Decode: The instructions are decoded so the control unit, ALU, and FPU can understand them – Execute: The instructions are carried out – Store: The original data or the result from the ALU or FPU execution is stored in the CPU’s registers 72 Understanding Computers: Today and Tomorrow, 13th Edition Making Computers Faster and Better Now and in the Future Improving performance today – Add more memory – Perform system maintenance Uninstall programs properly Consider placing large files on external storage devices Delete temporary files Error check and defragment Scan for viruses and spyware Clean out dust once or twice a year – Buy a larger or second hard drive – Upgrade your Internet connection – Upgrade your video graphics card 73 Understanding Computers: Today and Tomorrow, 13th Edition Making Computers Faster and Better Now and in the Future Strategies for faster and better computers – Improved architecture: Smaller components, faster bus speeds, multiple CPU cores, etc. – Improved materials: New backing materials, flexible circuits, etc. – Pipelining: Allows multiple instructions to be processed at one time – Multiprocessing and parallel processing: Use multiple processors to speed up processing 74 Understanding Computers: Today and Tomorrow, 13th Edition Pipelining 75 Understanding Computers: Today and Tomorrow, 13th Edition

Use Quizgecko on...
Browser
Browser