Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts...

37
Sahar Mosleh California State University San Marcos Page 1 Professional Awareness and Social Impacts of Computing

Transcript of Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts...

Page 1: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 1

Professional Awareness

and

Social Impacts of Computing

Page 2: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 2

Professional Awareness and Social Impacts of Computing

• Intellectual Property is property that is not physical but nevertheless has rights that can be assigned, licensed or used as collateral.

• Software product is an original work of authorship. Software product is protected by copyright law.

• The law was amended in 1980 to cover computer programs. Thus, you cannot copy a program without permission from the author.

• Only the author has the right to use, distribute and/or sell the work.

Page 3: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 3

What is protected?• The source text is protected.

• The ideas that underlie the expressions are not protected.

• e.g. ProgramA cannot be copied.

• Algorithm used in ProgramA can be expressed in another language, another style as long as it was not derived from ProgramA.

When is it protected?• Automatically protected from the day it was developed until 50

years after the author's death.

• there is no need to put the C mark but it is recommended.

Page 4: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 4

How does this apply to you?

• Even if you write a program as part of a computer course you are taking, your friend cannot take it and give to others or sell it to others without your permission.

• Related to this is Plagiarism.• you cannot include someone else's work in your work without

acknowledging the author.•You cannot copy someone else's function while working on a program unless you acknowledge that person. (e.g. include it in the comment above the function).

• Related to this also is Ownership.• Many universities automatically own your work if it was

produced using their machine.

• You cannot own the copy right. University does. If it is sold, they get the profit. Arrangements must be made with the university for you to be part owner.

Page 5: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 5

Patent

• Computer programs can now be patented by applying to the US Patent and Trademark office.

• Patent protection applies to the whole family of processes that have the same effect as the original product. In other words, the unique idea which underlie the product is protected.

• Using this idea, only the author can make, use and sell the product. Patent holds only for 17 years.

• Thus, unique and original algorithms can be patented.

• If you come up with the same idea independent of the patent holder, is it Ok?? No.

Page 6: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 6

Trademark

• You can also apply to the US Patent and Trademark office to get permission to use a unique symbol to identify your product. For software, it can also be placed on the manuals and documentation of the registered software.

Nondisclosure Agreement

• While working on a software product, you can make your employees sign a non-disclosure agreement which states that he/she cannot disclose the algorithm and ideas which underlie the product (and in many cases any document related to the project).

• This is difficult to enforce since employees can leavea project and work for another company.

Page 7: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 7

License to Use:

• By buying a computer program, you obtain the license to use that program. (source is not given out)

• License agreement usually states that you cannot make a copy of the software (and its documentation) without prior permission. But gives you the right to make one copy for backup.

• Also, states how it is sold without any warranty and they will not be held responsible.

• Universities and companies often obtain a site license. This allows us to install the software on X number of machines. (cheaper than buying X individual copies).

• Freeware can be obtained without any charge (ftp sites) • Shareware can be obtained by paying (voluntary) a small fee.

Page 8: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 8

Software Privacy

• Illegal copying and distribution of the programs is widespread. Manufacturers used to put in features which would make the copy not work, but clever users still found a way.

• University protects all software on their servers from being copied.

Page 9: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 9

• A: Should the Look and Feel of software be protected by copyright and/or patent? Which?

• How difficult would it be to enforce this?• Should we protect so much or let ideas improve through

distribution to other developers?Note: Apple sued Microsoft in 1988 for the Look and Feel of their GUI being imitated. Note the result, and also note the parallel suit by HP on somewhat different grounds.

• B: As software developers what responsibilities do you have to the customer? i.e. How do you protect yourself and your client from law suits??

• C: As software developer, what impacts on the society/people should you consider when you are asked to develop a program?

• List all possible impacts you should consider.

Page 10: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 10

Topics on

System

The contents of this particular lecture has been prepared by Dr. Rika Yoshii at department of Computer Science at CSUSM

Page 11: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 11

Agenda:

• Roles of Physical Components (implement, save, load, execute/run)

• Operating Systems Overview

• Programming Languages Overview

• Basic Terms (chips, memory, binary numbers)

• Main Subject Areas of Computing

Page 12: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 12

Roles of Physical Components

• Software Engineer writes a program: (Implementation)

• Enters a new program into the computer's Main Memory using Input Devices.

• (A program may also obtain previously stored data in a file on the Hard Disk)

• Tests the program by entering sample data using Input Devices.

• Observes the results on the Output Devices.

• Input Devices - keyboard, mouse, microphone, joysticks, etc

• Output Devices: Monitor/Screen (for display), Printer/Plotter (for hard copies), Disk drives (to files/databases on disks), speakers.

Page 13: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 13

• Software Engineer stores away the completed program: (SAVE)• Copies the program onto the Hard Disk or diskettes as a file.

(Main Memory is volatile - power off => lose content)

• The software is sold to the user.

• User puts the program on her Hard Disk: (INSTALL)

• User puts the program into the computer's brain: (LOAD and EXECUTE/RUN)

• Copies the program from the Hard Disk to the Memory.

• User enters the data when prompted by the program:• Inputs her data into the Main Memory.

Page 14: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 14

Operating System (OS) Overview

• It is the first thing you talk to when you turn on the computer.

• It is the Master program that coordinate the activities of all other software & hardware resources.

• OS Performs basic tasks - display files, copy files, list files, organize files into folders and directories, etc.

• Examples are:• [MS DOS + Windows for IBM compatibles]• [MacOS for Macintosh compatibles]• [UNIX for micros, Sun/HP workstations, big machines

(VAX, Sequent)]

Page 15: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 15

Program processes the data using CPU

• CPU (Central Processing Unit) is the brain with 2 parts:

• Control Section executes the instructions given as a program control routing of data among resources

• ALU (Arithmetic Logic Unit) - arithmetic and logic operations

• This will also access the Main Memory and changes its contents.

• Program shows the results:• Outputs the results.

Page 16: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 16

Programming Languages Overview

• A program is written in a high level programming language - not English or other natural languages.

• Different level of languages are:• Machine Language: Operates data in terms of 0's and 1's.

• Lowest level commands understood by a particular machine.

• Assembly Language: operation names and data address name

• High-level language: higher level readable statements that can be translated into various Machine Languages.

• (COMPILE = Translate; COMPILER = Translator)

• If a program written in a high level language can be understood by various compilers without modification, then it is PORTABLE.

• An organization called ANSI contributes to standardizing languages and thus making them more portable.

Page 17: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 17

• Famous programming languages are: Pascal, C, Ada, Basic, Cobol, Fortran, and C++ (LISP and PROLOG for Artificial Intelligent)

• Different languages have their strengths and weaknesses. • some are good for math• some for engineering• some for business• some make calculations easy• some make modifications easy and• some are more readable and easier to learn than the others.

• Languages have evolved in terms of readability, error checking, expressibility, efficiency, modularity, and portability.

Page 18: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 18

Some Basic Terms (Chips and Memory)

• Micro Computer:• Built around a micro processor CPU

• Micro Processor:• CPU on a single chip

• first one Intel 4004 in 1971.• Recent IBMs - Intel 386,486, etc. and Pentium,

PentiumPro• Macs - Motorola 68000; LC - 68030; Power PC- 601,

603e, 604e.)

Page 19: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 19

Memory Terms:

• Memory Types:

• RAM:• Random Access Memory (Main Memory)• holds programs, data, and computed results• you can read from and write to• It is volatile (power failure can cause the loss of data

Page 20: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 20

Non-volatile memory types:

• ROM• Read Only Memory:

• “how do boot” part of the operating system is in ROM; tells the processor to read from the disk into RAM)

• Capacity: usually much smaller than RAM

• Disks:• Can read and write but slow in spinning (10,000 to 10,000,000

times slower than RAM)• capacity: usually much bigger than RAM (e.g. gigabytes)

• the only moving part of the computer• some save backup copies every night

• Magnetic tapes (sequential access):• can be used for long term backup storage.

Page 21: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 21

• Memory Size:• How do we measure the size of the Memory?• How many bytes can be stored on the hard disk?• Your diskettes?• How do we say how big your files are?

• Numbers and characters are stored in terms of 0's and 1's.

• (i.e. if you were to look directly inside the memory in the raw form, all you see are 0's and 1's)

• Bit = 0 or 1 (Binary System)• Byte = 8 bits = can represent a character• KB = one kilo bytes = 210 bytes = 1024 bytes• MB = one mega bytes = 1024 KB• GB = one giga byte = 1K mega byte

Page 22: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 22

• Decimal: With 10 symbols (0 through 9), we go up to 9 and then onto 10, and from 19, we go to 20.

• Octal: With 8 symbols (0 through 7), we go up to 7 and then onto 10, and from 17, we go to 20.

• Binary: With 2 symbols (0 and 1), we go up to 1 and then onto 10, and from 11, we go to 100.

• Thus, digital 10 is octal ?? and binary ??

• Given binary digits dn dn-1 ..... d1 d0

• Equivalent decimal value is Sum of di * 2i (varying i from 0 to n)

• Thus, 1001 is: (1*20) + (0*21) +(0*22) +(1*23) = 1+8 = 9

• Similarly, given a octal number with digits: dn dn-1 ..... d1 d0

• Equivalent decimal value is Sum of di * 8i (varying i from 0 to n)

Thus, 105 in octal is : (5*80) + (0*81) +(1*82) = 5 + 0 + 64 = 69

Page 23: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 23

Radix (base) R to Decimal• Given a binary number (dn dn-1 .. d1 d0)

• d0 is for the 1s• d1 is for the 2s• d2 is for the 4s• d3 is for the 8s etc.

• Thus 111 represents 1 + 2 + 4

• If the above number (dn dn-1 ... d1 d0) was in radix R, what would be the summation to obtain the decimal value?

• Sum of di*Ri as i varies from 0 to n

• Hexadecimal and octal are often used as a short-hand notation for binary.

• With hexadecimal (radix 16), 10 is A, 11 is B, etc. 15 is F and 16 is 10.

Page 24: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 24

Decimal to Binary• Given a decimal number, if you divide it by 2, you get X and

remainder Y.

• the digit of the binary representation is given by Y?

• Now if we then divide X by 2, the remainder will be the digit of the binary representation??

• For example:• 121 in decimal is:

121/2 = 60 remainder = 160/2 = 30 remainder = 030/2 = 15 remainder = 015/2 = 7 remainder = 17/2 = 3 remainder = 13/2 = 1 remainder = 11/2 = 0 remainder = 1

• Thus binary representation is: 1111001

Page 25: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 25

Binary to Hexadecimal

• Since 16 = 24, group binary into 4 bits each.• 1010 0101 0011 in hexadecimal is thus A53

Binary to Hexadecimal

• Since 8 = 23, group binary into 3 bits each.• 101 001 010 in octal is: thus 512

• With M bits how many values can you represent ? 2M

• With 32 bits, how many values can you represent? 232

• If you need N values, how many bits are needed? log2 N

Page 26: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 26

Signed Integers

• With the signed binary values, the last (left-most) digit is used for the sign of the number.

• For example, with four digits we can represent 8 positive values (0 through 7) and 8 negative values (-1 through -8)

• Out of this 4 digits, three is used for representing the number and last digit is used to represent the sign of the binary value.

• In 4 digit binary system, if 0101 is 5, -5 is not 1101, but it is 2’s complement of 0101 which is 1011

• What is 2’s complement?

Page 27: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 27

Two's Complement

• Assume that we have M bits available.

• For -X, start from the right most digit of X and write it as it is moving to the right, till you reach the first 1, after that negate other bits.

• For example, 2’s complement of

00001101000 is11110011000

Or 2’s complement of 0000000000001 is1111111111111

Page 28: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 28

What's in the Memory? Overview

• RAM is Random-Access Memory:• Any address can be accessed in any operation: no

sequence required

• Data are written into memory cells and read from memory cells.

• ROM is Read-Only Memory:• Its contents are permanent:

• cannot write to them • can only read

• like RAM, can read in any sequence

Page 29: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 29

• What's in RAM?• executing program code (instructions)• variables we declare (and their values)• overhead information needed to execute programs data such as

• images of character fonts used to write onto the screen• audio data• records of each window on the screen, where it is, how to

draw it

• What is not in RAM?• permanent storage (deferred to disc or tape, or ROM)• full copies of massive data that don't all have to be in RAM at

once

Page 30: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 30

1) "Stored Program" logic:• the machine instructions comprising the program are stored

in memory

2) Sequential RAM memory, with an "address" for each cell

3) Program code executed one instruction at a time

4) CPU (Central Processing Unit) • reads RAM by supplying a memory address and waiting for

RAM to supply what's at that address • writes to memory by supplying the data and the (starting)

address in memory where the data is supposed to go.

• CPU is often called "processor". The whole machineis built around the CPU, and machines are identified with them.

Page 31: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 31

• CPU consists mainly of:

• the ALU(s)

• the Control Unit

• the instruction register

• the "instruction pointer" register

• several special-purpose data registers

• etc

Page 32: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 32

• CPU has connectors to external devices for input/output

• What is the ALU?• Arithmetic/Logic Unit• performs each of the most fundamental operations the

machine supplies:

• Arithmetic, e.g.:• add 2 numbers• multiply 2 numbers

• Logic, e.g.: "and”, "or“, "not"

• What is the Control Unit?• More below under Fetch and Execute cycle

• Which is faster??• using data that's in a CPU register• using data that you must obtain from RAM

Page 33: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 33

What is a Machine Language?

• The CPU has a "vocabulary" of instructions.

• This defines the fundamental operations a CPU is capable of performing.

• Each instruction written in a machine language is a specific pattern of 1 and 0 bits -- like switch settings

• Each instruction fits into the instruction register

• Each instruction causes the CPU to perform exactly one action

e.g. (imaginary machine language:) 0000000101010011 - add address 3 into address 5 0000000101011111 - add address 15 into address 5 0000101001011111 - "and" 1111 (binary) into address 5 0000011100100000 - jump to address 32

• Hard for humans to read, isn't it?

Page 34: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 34

What is the Instruction Cycle?• How CPU fetches and executes one machine language instruction

after another ( Also called the "fetch/execute" cycle )

• Fetch:• 1. instruction pointer tells where in memory the next

instruction is.• 2. Control Unit takes the instruction from memory, puts it into

the instruction register.

• Execute:• 3. Control Unit "decodes" it• 4. Control Unit obtains the operands, if any, that this

instruction needs.• 5. Uses the ALU, Control Unit, the CPU's registers, or

input/output devices (connectors to keyboard, screen, discs, etc.) as performing the particular instruction needs

• 6. repeat the cycle

Page 35: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 35

Assembly Language

• Uses symbolic (i.e. written, mnemonic) names for machine language instruction set lets us use names for memory locations (including locations in our code)

• One to one (usually!) correspondence of assembly instructions to machine language instructions

• Translated to machine language by a translator called an "assembler"

Page 36: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 36

• e.g. (imaginary assembly language:)

Add x, y • add memory word at location y to location x as

integers

Add x, a• add memory word at location a to location x as

integers

And x, 1111• apply logical "and" between 1111 binary and location

x and put result in location x

Jmp finish • jump to memory location finish; i.e. next instruction

Page 37: Sahar Mosleh California State University San MarcosPage 1 Professional Awareness and Social Impacts of Computing.

Sahar Mosleh California State University San Marcos Page 37

Digital Circuits

• ANDgate:• given 1 and 1, produce 1,• else produce 0

• ORgate: • given 1 and 0, given 0 and 1, given 1 and 1, produce 1, • else produce 0

• NOTgate given 1, produce 0, • given 0, produce 1

• Draw the circuit for (A AND B) OR (NOT-C)

ABC