Top-Rated Free Essay
Preview

Basic Computer Concepts

Powerful Essays
2407 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Basic Computer Concepts
CS 11 Handout
Outline
I Basic computer concepts A Definition of a computer B Number systems and conversion C Types of programming languages Program Development Cycle A Problem Identification B Logic Formulation C Coding D Testing and Debugging E Storage and Maintenance Program Logic Formulation A Algorithms B Algorithm Representation 1 Flowchart 2 Pseudocode Programming Fundamentals A Data Types B Variables and Constants C Operators D Expressions Control Structures A Sequential B Conditional C Iterative Modular Programming A Subprograms B Parameter-passing C Return values

electronic device as opposed to a simpler electric device. Electronic vs electric? A machine or device is electrical simply if it uses electricity for it to function. A machine, on the other hand, is electronic if it uses electrical charge in circuits and manipulates the flow of electricity to perform a variety of functions depending on where charge is routed. Hardware Hardware are the parts of a computer that are tangible or a person may sense. Components of a computer may also be classified according to their purpose. 01 Input devices exempli gratia, keyboard, mouse, microphone, scanner, et cetera 02 Output devices exempli gratia, monitor, speaker, printer, et cetera 03 Storage devices exempli gratia, diskettes, compact discs, bar codes, et cetera 04 Processor Some components now may perform more than one function. For example, touchscreens allow both input and output to be performed. Such devices are more aptly called interface devices. Other examples of these are Braille pads (keyboards with tactile and haptic feedback for persons who are visually-impaired) and CD-RW drives. CD-RW drives allow input by reading discs and output by writing to them. On the other hand, CD-ROM drives are only input devices as they do not have the functionality of writing on compact discs. Software Software is the intangible component of the computer. Software is what often makes modifications or controls what the hardware does. These are more flexible than the hardware as the user may modify these more conveniently. In addition, it is easier to create software than hardware.

II

III

IV

V

VI

Basic computer concepts
Definition of a computer A computer is defined as an electronic device that accepts input, stores and manipulates or processes data, and provides output in the form of useful information. With this definition, the four classical functions of a computer are defined. 01 02 03 04 Input Processing Output Storage

It is important to note that the concept of a modern computer involves it being an

Software may be classified as either 01 System software; or 02 Application software. System software are programs that deal directly with the hardware and bridges the hardware and the application software. Operating systems like Microsoft Windows, Linux, and Mac OS X allow for other programs to run on top of the hardware of the computer. To avoid having users deal with computers at a low level, application software are designed and made to make operating the computers much easier. Peopleware Peopleware is a modern term used to refer to anybody involved in the development or use of software or hardware systems. Technically, these persons are no longer part of the computer, but highly influence the technology attached to it. Number systems and conversion The numeral system we are used to as persons is not what the computer finds convenient to represent. This is borne out of the number of fingers by which a group of our ancestors used to count with. Each digit represented in a numeral system is magnified by a power of its base. For example, 24310 is a representation for 2×102 + 4×101 + 3×100 or 2×100 + 4×10 + 3×1. There are, in fact, other numeral systems used by different groups before. • The duo-decimal system was used by groups of Chinese by counting on each of the twelve finger segments on one hand aside from the thumb. • The sexagesimal system is an extension of this method by counting up to 12 on each finger segment on one hand for each finger on the other. • The vigesimal system was developed by the Mayans, Aztecs, and Celts by using all fingers and toes to count to 20. This is

also used by Eskimos in Greenland, the Tamanas of Venezuela, and the Ainu of Northern Japan. • The quinary system still being used in provinces in India today sees persons counting to 5 before moving to the next power. The computer, however, has no fingers or toes to count with. What it does understand, however, is the absence or presence of a signal, charge, or current. This led to the development of digital computers able to differentiate OFF from ON. This property, in turn, allowed for representation of numbers just using two digits: 0 and 1. Binary system The computer uses the binary system to represent everything from numbers to letters to photographs and more. Each signal of 0 or 1 is called a bit. A group of eight bits is called a byte. Half of a byte is called a nybble (or sometimes nibble). Carrying the wordplay forward, there have been moves to call other groups by the following names Term Size crumb two bits tayste playte 16 bits chawmp dynner 32 bits gawble tayble 64 bits However, usage of anything apart from a byte and a nybble are seldom used. A binary number 1011 01002 is a representation for 1×27 + 0×26 + 1×25 + 1×24 + 0×23 + 1×22 + 0x21 + 0×20 or 1×128 + 0×64 1×32 + 1×16 + 0×8 + 1×4 + 0×2 + 0×1 or 128 + 32 + 16 + 4 = 18010.

To represent a counting number in binary, you may perform either place-value subtraction or repeated division. Place-value subtraction To convert a decimal number to binary using place-value subtraction,
01

02

03

Get the largest power of 2 smaller than the number being converted. That would be the leftmost 1 in the binary number. Subtract the power of 2 from the original number. The power of 2 would then be halved. If it is larger than the difference from Step 02, write a 1 after the last written digit and go back to Step 02 again. Otherwise, write a 0 and repeat Step 03 if the power of 2 is still not 1.

Types of programming languages Since everything in computers are represented by a series of 0s and 1s, programs themselves are made out of binary sequences. It is completely possible to write programs using just 0s and 1s, but it would be incredibly difficult to do so. This is called machine code. Low-level programming languages are built on top of the machine code so it would be more convenient for humans to write programs without having to understand the intricacies of 0s and 1s. Furthermore, built on top of low-level programming languages are high-level languages. The give-and-take among these is the fact that despite being easier to code in a high-level language, low-level languages produce code that is more efficient. Program Development Cycle There are several models to the creation of software. One of the more simple ones involve five steps:
01 02 03 04 05

Repeated division To convert a decimal number to binary using repeated division,
01

02

Divide the number being converted by 2. The remainder would be the rightmost digit in the binary number. Keep on dividing until the quotient is 1. That 1 would be the leftmost digit in the binary number.

Though it is true that computers only understand binary, representing numbers in binary requires a long sequence of digits. As a compromise between persons and computers, numbers may also be represented in octal systems and hexadecimal numeral systems. Letters and other common characters are conveniently represented by a byte each. If a letter is being called for, each character is represented by a particular numerical equivalent. This was a standard established in 1963 so it will also be possible to have letters be coded with 1s and 0s with the American Standard Code for Information Interchange. A is represented by 65, B with 66, and so on. Other characters such as punctuation marks and other symbols also have their own numeric equivalents.

Problem analysis and definition Logic formulation Coding Testing and debugging Storage and maintenance

Problem analysis and definition involves identifying the reason for creating software and what the program requires to run properly. These are the following:
01

02

03

Output objective of the software, typically useful information transformed from input Given what are in the environment, what it takes to perform the transformation from pre-processed data to useful information Input what is needed from the user, whatever else is taken to be able to solve the problem

04

Restrictions a limiting factor to the input

Logic formulation is when the programmer creates the solution and puts it into terms that other programmers may possibly understand. This is the stage where an algorithm is developed. An algorithm is a step-by-step set of instructions that will lead the computer to an answer based on the variables to be in play. It is important in an algorithm to have a defined point at which the program will terminate An algorithm may take on one of several forms but the most common are a flowchart and a pseudocode. A flowchart is a graphical representation of the algorithm. Flow is directed from one operation to another using flow lines (arrows) and branches off in decision boxes (diamonds). Due to the dichotomous nature of computer decision-making, exactly two flow lines come out of a decision box. A pseudocode is textual representation of the flow. It could be in different formats, too. A recipe for a dish is an algorithm. A paragraph of detailed instructions is also an algorithm. For computer programs, a pseudocode may be written in numbered format as in the image below or may also be in indented format to denote blocks of execution.

Coding is the stage when the algorithm is keyed in to a file that the computer can translate then understand. This is when a programming language is involved. It is possible that after coding, the program may still not work due to errors for one or more case so it is important to try and break the program by testing and debugging. If at one point, an error is identified, it may be classified as either a syntax error or a semantic error. A syntax error means that something went wrong while coding. Often, programs will not even begin to run if a syntax error is encountered. On the other hand, a semantic error means that something went wrong in logic formulation or that the algorithm was coded incorrectly. Finally, storage and maintenance happens when users of the program may have needs that will come out in the future. At any point of the cycle, one may have to go back and re-examine the program for possible modifications. Programming Fundamentals Software need to remember values and modify data to be useful. To remember these, programs make use of variables. Variables may be of different types. They can be integers, fractions, characters, sequences of characters, and more. These are called data types. In many programming languages, once a variable is tied to a data type, it could no longer be changed. This means it is crucial to associate the correct data type to a variable. As opposed to variables, programming languages also employ constants. These variables and constants are used along with operators to form expressions.

This is executed in order and returns to continue execution at line 10 when line 30 is encountered. This is a bad algorithm as it does not have a defined termination condition.

Operators are used to embed particular functions that are performed on one or more values. In arithmetic, we’ve learned some of these operators (+, , ×, ÷).

Common operators for many programming languages are the following + arithmetic operators * / % ^ increment decrement assignment compound assignment ++ -= += -= *= /= %= < > = = or == or != && logical operators || ! ternary conditional addition subtraction or unary negation multiplication division modulo exponentiation (not available in C, used for bitwise XOR) add 1 subtract 1 assign value performs the operation on a variable and assigns to it less than greater than less than or equal to greater than or equal to equal to not equal to conjunction (AND) disjunction (OR) negation (NOT) evaluates to b if a is true; otherwise evaluates to c

03

Iterative

A program or program segment is considered sequential if it is straightforward in implementation. Id est, steps to transform data to information requires the same steps each time it is executed. It would then be conditional if a decision were made that affects how the program is run. Depending on the data and how the condition is stated, the program may run differently in different cases. Finally, it would be iterative if after a decision is made, it were possible for the program to go back and do the same operations over based on the condition and the status of the program. The distinguishing quality of a sequential program’s flowchart is one where all boxes have at most one flow line coming to it. The characteristic feature of a conditional program’s flowchart is the presence of a decision box that leads to different smaller program segments. To cap off, the property of an iterative program’s flowchart would be the presence of a flow line returning to segment of the flowchart that may have already been passed through.

comparison operators

Modular Programming
Many times, it would be more convenient for a programmer to reuse code or functions that would otherwise be repeated. This is where modular programming comes in handy. A program may be broken down into smaller modules, or subprograms, if the pieces of code will be used often. In these cases, subprograms could be represented by code just once in a program. If these subprograms were to need its own “sub-input”, parameters may be passed to it for it to complete its job. In return, it may pass back a value if the situation calls for it. This is called its return value.

a ? b : c

Expressions may also be joined by operators to form even bigger expressions.

Control structures

Well-formed software and program segments adhere to one of the following control structures:
01 02

Sequential Conditional

You May Also Find These Documents Helpful

  • Good Essays

    Intro to Computers

    • 609 Words
    • 3 Pages

    | Allows users to organize data in rows and columns and perform calculations and recalculate when data changes.…

    • 609 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 Chapter 24 Chapter 25 Chapter 26 Chapter 27 An Introduction to Hardware, Software, and the Internet An Introduction to Software Development Objects and Classes Algorithms Java Syntax and Style Data Types, Variables, and Arithmetic Boolean Expressions and if-else Statements Iterative Statements: while, for, do–while Implementing Classes and Using Objects Strings Class Hierarchies and Interfaces Arrays…

    • 3908 Words
    • 16 Pages
    Powerful Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    An introduction to computer programming with an emphasis on problem solving will be presented. Specific topics include:…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Powerful Essays

    The purpose of this Lab. is to familiarize student how to solve practical problems programmatically; they will practice on elementary programming using primitive data types, variables, constants, operators, expressions, and input and output. Also, they will learn how to diagnose errors that may occur when a program is compiled or executed. There are some exercises, through which they will understand the concept learn in this chapter.…

    • 2338 Words
    • 10 Pages
    Powerful Essays
  • Powerful Essays

    The following information will introduce general knowledge in basic programming concepts. It shall discuss basic types of computer programming languages as-well-as program development. There are three basic types of computer programming languages that will be discussed in a simple and easy to understand manner. We shall also describe the program development cycle and discuss why it is important to use a structured and organized process to create a computer programming language.…

    • 1318 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    1. Flash cards: It is similar to the traditional note cards but in electronic bases. It helps students to recall the terms and definitions of the textbook.…

    • 695 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Computer Basics

    • 330 Words
    • 2 Pages

    Answer each question fully. Complete sentences are not necessary, but some questions may require more than one sentence to answer them fully.…

    • 330 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Computer Concepts Exercises

    • 2338 Words
    • 10 Pages

    011000 The list of codes for a microprocessor’s instruction set is called machine language. (Answer: True)…

    • 2338 Words
    • 10 Pages
    Good Essays
  • Powerful Essays

    |1.2 Demonstrate an understanding of the |Code listings show a variety of objects | |…

    • 2281 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    Comm 101

    • 990 Words
    • 4 Pages

    References: n.a, 2002, Kant 's Ethics: Some Key Ideas. Available: http://www.trinity.edu/cbrown/intro/kant_ethics.html. Last accessed 9th sep 2012.…

    • 990 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Intro to Computers

    • 340 Words
    • 2 Pages

    Submit complete answers to the following end-of-chapter Review Questions [RQ] from the Digital Planet: Tomorrow's Technology and You textbook.…

    • 340 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    I have learned many things from this class as it relates to computer programming. There are a few areas covered in this course by either the text or in our weekly class discussions about computers and computer programming that stood out to me. This paper is broken up into two discussions. The first part will cover general ideas and skills involved with computers and computer programming. The second part of my paper will go over some topics covered in the text for the class. Some areas that were discussed are as follows: Logic and Decision Structures, Using Repetition Structures, Checking user input for errors and lastly, Using Arrays for more Advanced Programs.…

    • 1406 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    The basic components of all computer systems whether they are microcomputers or supercomputer all contain six basic building blocks: input, output, memory, arithmetic/logical unit, control unit and files. A computer system needs input devices for entering data into the computer for processing. The most common input devices are keyboards and mice. Input devices have now expanded to other methods such as voice input, magnetic ink character recognition (MICR), Optical character recognition (OCR), scanning bar code label, etc. The output devices are used to produce the results of the processing done by the computer. The most common output devices include computer screen or monitor, printer, or writing output on CD or DVD. Computer memory or main memory holds the program instructions and data. All data flows are to and from memory. Arithmetic and Logic Unit consist of incredibly small integrated circuits on a silicon chip. It is mainly responsible for arithmetic function of addition, subtraction, multiplication and division calculation, logical comparison and decision. Computer files storage devices sometimes called secondary or backing storage is used to store programs and data when they are not being used. Secondary storage is nonvolatile. File devices include hard disk drive, magnetic tape drives, flash drives, and CD or DVD. Control Unit provides the control that enables the computer to take advantage of the speed and capacity of its other components. It controls the sequence of instruction to be executed, controls the flow of data, interpret instructions, and it regulate timing of processor (Brown et al., 2012).…

    • 569 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    C++ Notes

    • 2751 Words
    • 12 Pages

    Computer Programming – 1 Details of Syllabus: Sr. No 1 1.1 1.2 Structure Programming using C++ C++ as a superset of C programming language C++ fundamental : Character set, Identifiers & Keywords, data types, Constants & Variables 1.3 Declaration : Operators & Expressions, Library function statements, Symbolic constants, Preprocessor directives 2 2.1 Data Input and Output & Control Statements getchar( ), putchar( ), scanf( ), printf( ), gets( ), puts( ),cin, cout, setw( ), endl, 2.2 If-else, while, do-while, goto, for, nested control structures, switch, break, continue statements, comma operator 3 3.1 Function and Arrays Function prototypes, passing arguments to a function by value and by reference, recursion overloading functions, storage classes 3.2 Defining processing array, passing array to functions, introduction to multidimensional array and strings 4 4.1 Pointers, Structure and Unions Declarations. Referencing & dereferencing passing pointer functions , pointer to functions , pointer to arrays 4.2 4.3 5 5.1 Structure & Unions. Defining and processing a structure Creation and manipulation of linked list Object Oriented Programming using C++ Classes, Objects, Data encapsulation, access specifiers, private, public and protected inheritance in details, operator overloading of unary and binary arithmetic operators, virtual functions, pure virtual functions 6 6.1 Late binding, friend function, object as function parameter, overriding functions, overload constructors, copy constructors, static class member 6 8 5 7 6 5 Details Hrs…

    • 2751 Words
    • 12 Pages
    Powerful Essays
  • Powerful Essays

    Introduction to Computers

    • 1230 Words
    • 5 Pages

    1. In computer use, the skill of typing is often referred to as _________________. 2. IBM-compatible PCs have 10 or 12 _________________ keys. 3. In many programs, an on-screen symbol called a(n) __________________ or a(n) _________________ shows you where you are in a document. 4. A(n) _________________ is a temporary storage area that holds data until the CPU is ready for it. 5. In addition to pointing, the four primary mouse techniques are __________________, __________________, __________________, and ___________________. 6. You use a mouse (or one of its variants) to position a(n) _________________ on the screen. 7. In many Windows applications, you can open a shortcut menu by ________________ the mouse. 8. Many laptop computers feature a small joystick between the G and H keys, which is called a(n) _________________ or a(n) _________________. 9. _________________ is the study of the way people work with tools. 10. _________________ is a common type of repetitive stress injury among computer users.…

    • 1230 Words
    • 5 Pages
    Powerful Essays