Docsity

computer hardware and system software 3, Slides of Computer Fundamentals

Partial preview of the text

Download computer hardware and system software 3 and more Slides Computer Fundamentals in PDF only on Docsity!

MIS 2103

Computer Hardware and

System Software

Fall 2023

Lecture

Fractions

§ Number point or radix point

§ Decimal point in base 10

§ Binary point in base 2

§ No exact relationship between fractional

numbers in different number bases

§ Exact conversion may be impossible

  • Fractions: Base 10 and Base
    • Place 10 -^1 10 -^2 10 -^3 10 -
    • Value 1/10 1/100 1/1000 1/
    • Evaluate 2 x 1/10 5 x 1/100 8 x 1/1000 9 x1/
    • Sum .2 .05 .008.
      • .101011 2 = 0.671875
      • Place 2 -^1 2 -^2 2 -^3 2 -^4 2 -^5 2 -
      • Value 1/2 1/4 1/8 1/16 1/32 1/
      • Evaluate 1 x 1/2 0 x 1/4 1x 1/8 0 x 1/16 1 x 1/32 1 x 1/
      • Sum .5 0.125 0.03125 0.
        • .2589

Fractions: Base 10 and Base 2 § No general relationship between fractions of types 1/ k and 1/ k § Therefore a number representable in base 10 may not be representable in base 2 § But: the converse is true: all fractions of the form 1/

k

can be represented in base 10 § Fractional conversions from one base to another are stopped § If there is a rational solution or § When the desired accuracy is attained

Data Formats

§ Computers

§ Process and store all forms of data in binary

format

§ Human communication

§ Includes language, images and sounds

§ Data formats:

§ Specifications for converting data into computer-

usable form

§ Define the different ways human data may be

represented, stored and processed by a computer

Sources of Data

§ Binary input

§ Begins as discrete input

§ Example: keyboard input such as A 1+2=3 math

§ Keyboard generates a binary number code for each key

§ Analog

§ Continuous data such as sound or images

§ Requires hardware to convert data into binary numbers

Computer 1101000101010101… Input device A 1+2=3 math

Data Types: Numeric

§ Used for mathematical manipulation

§ Add, subtract, multiply, divide

§ Types

§ Integer (whole number)

§ Real (contains a decimal point)

Data Types: Alphanumeric

§ Alphanumeric:

§ Characters: b T

§ Number digits: 7 9

§ Punctuation marks:! ;

§ Special-purpose characters: $ &

§ Numeric characters vs. numbers

§ Both entered as ordinary characters

§ Computer converts into numbers for calculation

p Examples: Variables declared as numbers by the

programmer (Salary$ in BASIC)

§ Treated as characters if processed as text

p Examples: Phone numbers, ZIP codes

Representing Characters

§ ASCII - most widely used coding

scheme

§ EBCDIC: IBM mainframe (legacy)

§ Unicode: developed for worldwide use

ASCII

§ Developed by ANSI (American National

Standards Institute)

§ Represents

§ Latin alphabet, Arabic numerals, standard

punctuation characters

§ Plus small set of accents and other

European special characters

§ ASCII

§ 7 - bit code: 128 characters

EBCDIC

§ Extended Binary Coded Decimal Interchange

Code developed by IBM

§ Restricted mainly to IBM or IBM compatible

mainframes

§ Conversion software to/from ASCII available

§ Common in archival data

§ Character codes differ from ASCII

ASCII EBCDIC

Space 2016

A 4116 C1 16

b 6216

Unicode

§ Most common 16-bit form represents 65,

characters

§ ASCII Latin-I subset of Unicode

§ Values 0 to 255 in Unicode table

§ Multilingual : defines codes for

§ Nearly every character-based alphabet

§ Large set of ideographs for Chinese, Japanese

and Korean

§ Allows software modifications for local-

languages

Control Code Definitions

Keyboard Input

§ Scan code

§ Two different scan codes on keyboard

p One generated when key is struck (press) and another

when key is released

§ Converted to Unicode, ASCII or EBCDIC by

software in terminal or PC

§ Advantage

§ Easily adapted to different languages or keyboard

layout

§ Separate scan codes for key press/release for

multiple key combinations

p Examples: shift and control keys