22

ITCS Assignment

Embed Size (px)

Citation preview

Page 1: ITCS Assignment
Page 2: ITCS Assignment

Page | 2

F-2,Block, Amity CampusSec-125, Nodia (UP)

India 201303ASSIGNMENTS

PROGRAM: Post Graduate Diploma in IT

SEMESTER-I

Subject Name Introduction to IT and CSStudy COUNTRY SOMALIA LCPermanent Enrollment Number (PEN) DIT02512012-2013014Roll NumberStudent Name Mohamed Abdullahi Khalaf

INSTRUCTIONSa) Students are required to submit all three assignment sets.

ASSIGNMENT DETAILS MARKSAssignment A Five Subjective Questions 10Assignment B Three Subjective Questions + Case Study 10Assignment C 45 Objective Questions 10

b) Total weightage given to these assignments is 30%. OR 30 Marksc) All assignments are to be completed as typed in word/pdf.d) All questions are required to be attempted.e) All the three assignments are to be completed by due dates (specified

from time to time) and need to be submitted for evaluation by AmityUniversity.

f) The evaluated assignment marks will be made available within sixweeks. Thereafter, these will be destroyed at the end of eachsemester.

g) The students have to attached a scan signature in the form.

Signature: _________________________________Date: 12/12/2012

( √ ) Tick mark in front of the assignments submitted

Assignment ‘A’ √ Assignment ‘B’ √ Assignment ‘C’ √

Page 3: ITCS Assignment

Page | 3

INTRODUCTION TO IT AND CS

Assignment A

Q: 1). Explain register transfer language..

Answer:

In computer science, register transfer language (RTL) is a kind ofintermediate representation (IR) that is very close to assembly language,such as that which is used in a compiler. Academic papers and textbooksalso often use a form of RTL as an architecture-neutral assemblylanguage. RTL is also the name of a specific IR used in the GNU CompilerCollection, and several other compilers, such as Zephyr.

The symbolic notation used to describe the micro -operation transferamong registers is known as register transfer language. A register transferlanguage is a system for expressing in symbolic form the micro-operationsequences among the registers of digital module.

RTL is a simple, human-oriented language to specify the operations,register communication and timing of the steps that take place within aCPU to carry out higher level (user programmable) instructions.

Computer registers are designated by capital letters to denote the functionof registers eg. The register that holds an address for the memory unit isusually called a memory address register and is designated by the nameMAR. Other designation for registers are PC (for programme counter), IR(for instruction register), and R1 (for processor register). The individual flipflops is an n-bit register are 3 numbered in sequence from zero through n-1, starting from zero is the right most position and increasing the numbertowards the left.

Block diagram of register

• Copying the contents of one register to another is a register transfer• A register transfer is indicated as R2 R1

Page 4: ITCS Assignment

Page | 4

– In this case the contents of register R2 are copied (loaded) intoregister R1

– A simultaneous transfer of all bits from the source R1 to thedestination register R2, during one clock pulse.

– Note that this is a non-destructive; i.e. the contents of R1 arenot altered by copying (loading) them to R2

Q: 2). What are peripheral devices list them.

Answer:

Peripheral Devices are computer devices, such as a CD-ROM drive orprinter, that is not part of the essential computer, i.e., the memory andmicroprocessor. Peripheral devices can be external - such as a mouse,keyboard, printer, monitor, external Zip drive or scanner - or internal,such as a CD-ROM drive, CD-R drive or internal modem. Internalperipheral devices are often referred to as integrated peripherals.

List of peripheral devices include:

Keyboard Mouse Monitor Printer Scanner Microphone Speaker CD-ROM drive Joystick Modem

Q: 3). Describe the circuit implementation of function xy’+yz.

Answer:

Combinatorial Logic Circuit that implements the function xy’+yzDeMorgan’s Law

(ab)’=a’+b’(a+b)’=a’b’

• Property for generating equivalent functions

Page 5: ITCS Assignment

Page | 5

• Allows conversion of AND function to an equivalent OR function andvice-versa

• It may allow the simplification of complex functions, that will allow asimpler design

• It is useful in generating the complement of a function.

(xy’ + yz)’ = (xy’)’(yz)’ = (x’ + y)(y’ + z’) = x’y’ + x’z’ + yy’ + yz’ (becauseyy’=0) => (xy’+yz)’ = x’y’ + x’z’ + yz’

x Y z x'y' x'z' yz' x'y‘ + y'z‘ + yz'

0 0 0 1 1 0 1

0 0 1 1 0 0 1

0 1 0 0 1 1 1

0 1 1 0 0 0 0

1 0 0 0 0 0 0

1 0 1 0 0 0 0

1 1 0 0 0 1 1

1 1 1 0 0 0 0

Q: 4). What is the difference between assembler, compiler andinterpreter?

Answer:

The difference between assembler, compiler and interpreter is that:

Compiler: is a program that translates English-like words of high-levellanguage into the machine language of a computer. A compiler reads agiven program called a Source Code and then, translates the program intothe machine language, which is called an Object Code.

Eg. When you run a program in C or high level language, it is donethrough compiler to convert them automatically into the machine levellanguage.

X

y

zxy' + yz

Page 6: ITCS Assignment

Page | 6

A computer translates an assembly language program from mnemonics tothe binary machine code of a computer. It is used when we write aprogram in assembly level language and execution is performed, Itconverts the that assembly level language into computer understandablelevel language i.e. binary machine code.

Compiler translates high-level instructions directly into machine language.Compiled programs generally run faster than interpreted programs.

The compiler has a number of phases plus symbol table manager and anerror handler.

Input Source Program -> Lexical Analyzer -> Syntax Analyzer -> SymbolTable Manager Semantic Analyzer Error Handler -> Intermediate CodeGenerator -> Code Optimizer -> Code Generator -> Out Target Program

Structure of a compiler

Compilers bridge source programs in high-level languages with theunderlying hardware. A compiler requires 1) determining the correctnessof the syntax of programs, 2) generating correct and efficient object code,3) run-time organization, and 4) formatting output according to assemblerand/or linker conventions.

A compiler consists of three main parts: the frontend, the middle-end,and the backend.

The front end checks whether the program is correctly written in terms ofthe programming language syntax and semantics. Here legal and illegalprograms are recognized. Errors are reported, if any, in a useful way. Typechecking is also performed by collecting type information. The frontendthen generates an intermediate representation or IR of the source code forprocessing by the middle-end.

The middle end is where optimization takes place. Typicaltransformations for optimization are removal of useless or unreachablecode, discovery and propagation of constant values, relocation ofcomputation to a less frequently executed place (e.g., out of a loop), orspecialization of computation based on the context. The middle-endgenerates another IR for the following backend. Most optimization effortsare focused on this part.

The back end is responsible for translating the IR from the middle-endinto assembly code. The target instruction(s) are chosen for each IRinstruction. Register allocation assigns processor registers for the programvariables where possible. The backend utilizes the hardware by figuring

Page 7: ITCS Assignment

Page | 7

out how to keep parallel execution units busy, filling delay slots, and soon. Although most algorithms for optimization are in NP, heuristictechniques are well-developed.

Interpreter: is a program that translates the English-like statements of ahigh-level language into the machine language of a computer. It translateshigh-level instructions into an intermediate form, which it then executes.An interpreter translates one statement at a time from a source code to anobject code.

Interpretation does not replace compilation completely. It only hides itfrom the user and makes it gradual. Even though an interpreter can itselfbe interpreted, a directly executed program is needed somewhere at thebottom of the stack (see machine language). Modern trends toward just-in-time compilation and bytecode interpretation at times blur thetraditional categorizations of compilers and interpreters.

Other languages have features that are very easy to implement in aninterpreter, but make writing a compiler much harder; for example, APL,SNOBOL4, and many scripting languages allow programs to constructarbitrary source code at runtime with regular string operations, and thenexecute that code by passing it to a special evaluation function.

Assembler: Assembler is a program that translates programs fromassembly language to machine language is called as Assembler.

An assembly language is a low-level programming language forcomputers, microprocessors, microcontrollers, and other programmabledevices. It implements a symbolic representation of the machine codesand other constants needed to program a given CPU architecture. Thisrepresentation is usually defined by the hardware manufacturer, and isbased on mnemonics.

Q: 5). What are the different level of programming languages?

Answer:

A programming language is used by a human programmer to direct acomputer to accomplish a specific set of steps whichlead to a desired outcome.

The figure at right illustrates several key pointsabout programming languages. First, programminglanguages are built upon and relate directly to theunderlying computer (hardware). In fact, they aredesigned to control the operation of the hardware.

Page 8: ITCS Assignment

Page | 8

Second, these programming languages can be divided into three differentlevels. They are:

Machine Languages Assembly Languages and High-level Languages

Machine language is the "native tongue" of the computer, the languageclosest to the hardware itself. Each unique computer has a uniquemachine language. A machine language program is made up of a series ofbinary patterns (e.g., 01011100) which represent simple operations thatcan be accomplished by the computer (e.g., add two operands, move datato a memory location). Machine language programs are executable,meaning that they can be run directly. Programming in machine languagerequires memorization of the binary codes and can be difficult for thehuman programmer.

Machine Language is the fundamental language of the computer’sprocessor. It is also called Low Level Language.

All programs are converted into machine language before they canbe executed.

Consists of combination of 0’s and 1’s that represent high and lowelectrical voltage.

Assembly language represents an effort to make programming easier forthe human. The machine language instructions are replaced with simplepneumonic abbreviations (e.g., ADD, MOV). Thus assembly languages areunique to a specific computer (machine). Prior to execution, an assemblylanguage program requires translation to machine language. Thistranslation is accomplished by a computer program known as anAssembler. Assemblers are written for each unique machine language.

• Assembly Language is low level language that is similar to machinelanguage.

• Uses symbolic operation code to represent the machine operationcode.

High-level languages are more English-like and, therefore, make it easierfor programmers to "think" in the programming language. High-levellanguages also require translation to machine language before execution.This translation is accomplished by either a compiler or an interpreter.Compilers translate the entire source code program before execution.Interpreters translate source code programs one line at a time.Interpreters are more interactive than compilers.

Page 9: ITCS Assignment

Page | 9

• High-level Language is Computer programming languages that iseasier to learn.

• Uses English like statements.• Examples are C ++, Visual Basic, Pascal, Fortran and …

Page 10: ITCS Assignment

Page | 10

Assignment B

Q: 1). Explain memory hierarchy in brief.

Answer:

The memory unit is an essential components in any digital computer sinceit is needed for strong progress and data.

The hierarchical arrangement of storage in current computer architecturesis called the memory hierarchy. It is designed to take advantage ofmemory locality in computer programs. Each level of the hierarchy is ofhigher speed and lower latency, and is of smaller size, than lower levels.

Most modern CPUs are so fast that for most program workloads thelocality of reference of memory accesses, and the efficiency of the cachingand memory transfer between different levels of the hierarchy, is thepractical limitation on processing speed. As a result, the CPU spendsmuch of its time idling, waiting for memory I/O to complete.

The memory hierarchy in most computers is as follows:

Processor registers – fastest possible access (usually 1 CPU cycle), onlyhundreds of bytes in size

Level 1 (L1) cache – often accessed in just a few cycles, usually tens ofkilobytes .

Level 2 (L2) cache – higher latency than L1 by 2× to 10×, often 512KB ormore .

Level 3 (L3) cache – (optional) higher latency than L2, often multiple MB'sMain memory (DRAM) – may take hundreds of cycles, but can be multiplegigabytes .

Disk storage – hundreds of thousands of cycles latency, but very large.

The term memory hierarchy is used in computer architecture whendiscussing performance issues in computer architectural design,algorithm predictions, and the lower level programming constructs suchas involving locality of reference. A 'memory hierarchy' in computerstorage distinguishes each level in the 'hierarchy' by response time. Sinceresponse time, complexity, and capacity are related, the levels may also bedistinguished by the controlling technology.

Page 11: ITCS Assignment

Page | 11

The many trade-offs in designing for high performance will include thestructure of the memory hierarchy, i.e. the size and technology of eachcomponent. So the various components can be viewed as forming ahierarchy of memories (m1,m2,...,mn) in which each member mi is in asense subordinate to the next highest member mi-1 of the hierarchy. Tolimit waiting by higher levels, a lower level will respond by filling a bufferand then signaling to activate the transfer.

There are four major storage levels.

1. Internal – Processor registers and cache.2. Main – the system RAM and controller cards.3. On-line mass storage – Secondary storage.4. Off-line bulk storage – Tertiary and Off-line storage.

This is a most general memory hierarchy structuring. Many otherstructures are useful. For example, a paging algorithm may be consideredas a level for virtual memory when designing a computer architecture.

Most general purpose computer would run more efficiently if they wereequipped with additional storage device beyond the capacity of mainmemory. The main memory unit that communicates directly with CPU iscalled the MAIN MEMORY . Devices that provide backup storage arecalled AUXILARY MEMORY. Most common auxiliary devices are magneticdisks and tapes they are used for strong system programs, large data filesand other backup information. Only programs and data currently neededby the processor resides in main memory. All other informations arestored in auxiliary memory and transferred to the main memory whenneeded.

The main memory hierarchy system consists of all storage devicesemployed in a computer system from the slow but high –capacity auxiliarymemory to a relatively faster main memory, to an even smaller and fastercache memory accessible to the high-speed processing logic. MemoryHierarchy is to obtain the highest possible access speed while minimizingthe total cost of the memory system.

Memory Hierarchy in computer system

Page 12: ITCS Assignment

Page | 12

A very high speed memory is called cache memory used to increase thespeed of processing by making current programs and data available tothe CPU at rapid rate. The cache memory is employed in the system tocompensates the speed differential between main memory access timeand processor logic.

Q: 2). What do you understand by parallel processing?

Answer:

Parallel processing is a term used to denote a large class of techniquesthat are used to provide simultaneous data processing tasks for thepurpose of increasing the computational speed of computer. The purposeof parallel processing is to speed up the computer processing capabilityand increased its throughput that is, the amount of processing can beaccomplished during a interval of time the amount of hardware increaseswith parallel processing and with it the cost of system increases.

Processor with multiple functional units 8.1

Parallel processing at a higher level of complexity can be achieved byhaving a multiplicity of functional units that perform identical or differentoperation simultaneously. Parallel processing is established bydistributing the data among the multiple functional units. . For example,the arithmetic, logic, and shift operations can be separated into threeunits and the operands diverted to each unit under the supervision of acontrol unit . The normal operation of a computer is to fetch instructionsfrom memory and execute them in the processor.

The sequence of instructions read from memory constitutes an instructionstream. The operations performed on the data in the processor constitutes

Page 13: ITCS Assignment

Page | 13

a data stream. Parallel processing may occur in the instruction stream, inthe data stream, or in both. Flynn's classification divides computers intofour major groups as follows:

1. Single instruction stream, single data stream (SISD)2. Single instruction stream, multiple data stream (SIMD)3. Multiple instruction stream, single data stream (MISD)4. Multiple instruction stream, multiple data stream (MIMD)

SISD represents the organization of single computer containing a controlunit, a processor unit and memory unit. Instruction are executedsequentially and system may or may not have internal parallel processingcapabilities. Parallel processing in this case may be achieved by means ofmultiple functional units or by pipeline processing.

SIMD represents an organization that includes many processing unitsunder the supervision of a common control unit .All processor receive thesame instruction from the control unit but operate on the different itemsof data. The shared memory unit must contain multiple modules so that itcan communicate with all the processors simultaneously. MISD structureis only of theoretical interest since no practical system has beenconstructed using this organization. MIMD organization refer to computersystem capable of processing several programs at the same time. Mostmultiprocessor and multicomputer systems can be classified in thiscategory.

Flynn's classification depends on the distinction between the performanceof the control unit and the data-processing unit. It emphasizes thebehavior characteristics of the computer system rather than itsoperational and structural interconnections. One type of parallelprocessing that does not fit Flynn's classification is pipelining.

Q: 3). What is array processor and what is the role of attachedarray processor?

Answer:

An array processor also called a vector processor is a microprocessor thatexecutes one instruction at a time but on an array or table of data at thesame time rather than on single data elements. It is a central processingunit (CPU) that implements an instruction set containing instructions thatoperate on one-dimensional arrays of data called vectors. This is incontrast to a scalar processor, whose instructions operate on single dataitems. Array processors can greatly improve performance on certainworkloads, notably numerical simulation and similar tasks.

Page 14: ITCS Assignment

Page | 14

An Array processor performs computations on large arrays of data. Theterm is used to refer two different types of processor . An attaché arrayprocessor is an auxiliary processor attached to general purpose computer.It is intended to improve the performance of the host computer inspecific numerical computation tasks. An SIMD processor is a processorthat has single instruction multiple data organization. It manipulatesvector instructions by means of multiple functional units responding to acommon instruction . Although both types of array processors manipulatevector , their organization is different.

Attached Array Processor

An attached array processor is designed as a peripheral for conventionalhost computer, and its purpose is to enhance the performance ofcomputer by providing Vector processing for complex applications. Itachieves high performance by means of parallel processing with multiplefunctional units. It includes an arithmetic unit containing one or morepipelined floating point adders and multipliers. The array processor canbe programmed by the user to accommodate variety of complex arithmeticproblems.

Attached array processor with host computer

SIMD Array Processor

An SIMD array processor is a computer with multiple processing unitsoperating in parallel. The processing units are synchronized to performthe same operation under the control of common control unit, thusproviding a single instruction stream, multiple data stream organization.A general block diagrams of an array is shown in the below diagram. Itcontains a set of identical processing elements (PE),each having a localmemory M. Each processor includes an ALU, a floating point arithmeticunit , and working registers. The master control unit controls theoperations in the processor elements. The main memory is used forstorage of the program. The Function of the master control unit is decodethe instructions and determine how the instructions and determine howthe instruction is to be executed. Scalar and program control instructions

Page 15: ITCS Assignment

Page | 15

are directly executed within the master control units. Vector instructionsare broad cast to all PEs simultaneously. Each PE uses operand stored inits local memory. Vector operands distributed to the local memories priorto parallel execution of the instruction.

There is no case study

Page 16: ITCS Assignment

Page | 16

Assignment –C

(Multiple Choice Question)

Q: 1). The world’s fastest and most advanced computer.

a) Main frames Computersb) Super Computers (√)c) Personal Computersd) Mini Computers

Q: 2). Who is the father of computers.

a) Blaise Pascalb) Charles Babbage (√)c) Konrad Zused) John Atanasoff

Q: 3). Who invented Pascalin.

a) Blaise Pascal (√)b) Charles Babbagec) Konrad Zused) John Atanasoff

Q: 4). Who invented ABC .

a) Blaise Pascalb) Charles Babbagec) Konrad Zused) John Atanasoff (√)

Q: 5). ___________ earned the semiofficial title of "inventor of themodern computer"

a) Blaise Pascalb) Charles Babbagec) Konrad Zuse (√)d) John Atanasoff

Q: 6). MARK series of computers was designed by

a) Konrad Zuseb) John Atanasoffc) Howard Aiken (√)d) Blaise Pascal

Page 17: ITCS Assignment

Page | 17

Q: 7). The computers of ________ generation replaced vacuumtubes with transistors.

a) 1st

b) 2nd (√)c) 3rd

d) 4th

Q: 8). EDVAC stand for

a) Electronic Discrete Variable Automatic Computer (√)b) Electronic Discrete Variable Automatic Calculator.c) Electric Discrete Variable Automatic Computer.d) Electric Dependent Variable Automatic Calculator.

Q: 9). _____________ type of computers recognizes data bycounting discrete signal of (0 0r 1), they are high speedprogrammable; they compute values and stores results.

a) Digital computer (√)b) Analog Computerc) Hybrid Computerd) Super Computer

Q: 10). In the decimal number system, there are _________possible values.

a) 2b) 10 (√)c) 8d) 16

Q: 11). In a positional notation system, the number base is calledthe __________.a) radix (√)b) radiusc) remixd) base value

Q: 12). The decimal number 163 would be represented in BCD asfollows.a) 0001 0110 0011 (√)b) 0001 0011 0110c) 0001 0011 0001d) 0001 0001 0110

Page 18: ITCS Assignment

Page | 18

Q: 13). When a fixed precision binary number is used to hold onlypositive values, it is said to be

a) unsigned (√)b) Signedc) Positived) Negitave

Q: 14). The binary number system is ________ numbering system.

a) positional notation (√)b) non-positional notationc) signedd) unsigned

Q: 15). Convert 3710 to binary

a) 100100b) 100101 (√)c) 101101d) 100110

Q: 16). Convert the binary number 01011011 to a hexadecimalnumber.

a) B5b) 5B (√)c) 4Bd) B6

Q: 17). Sometimes called __________, memory consists of one ormore chips on the motherboard or some other circuit board inthe computer.

a) primary storage (√)b) auxiliary storagec) secondary storaged) permanent storage

Q: 18). Examples of storage media are all of the following except__________.

a) floppy disksb) expansion cards (√)c) compact disksd) tape

Page 19: ITCS Assignment

Page | 19

Q: 19). A __________, is a narrow recording band that forms a fullcircle on the surface of a disk.

a) track (√)b) clusterc) shutterd) sector

Q: 20). A disk’s storage locations consist of pie-shaped sections,which break the tracks into small arcs called __________.

a) backupsb) clustersc) shuttersd) sectors (√)

Q: 21). Hard disks provide for __________ access times than floppydisks.

a) lesser storage capacities and much slowerb) greater storage capacities but much slowerc) lesser storage capacities but much fasterd) greater storage capacities and much faster (√)

Q: 22). Below are the major structural components of CPUexcept:

a) Control Unitb) ALUc) Registers (√)d) RAM

Q: 23). “A hypothesis that states transistor densities in a singlechip will double every 18 months”

a) More’s Lawb) CPU’s Lawc) Moore’s Law (√)d) Transistor’s Law

Q: 24). RISC stands for

a) Reduced Instruction Set Computer (√)b) Redundant Instruction Set Computerc) Reduced Information Set Computerd) Reduced Instruction Set Chip

Page 20: ITCS Assignment

Page | 20

Q: 25). _______ is not an auxiliary memory.

a) RAM (√)b) Hard Diskc) Tapesd) DVD

Q: 26). _____________ is most commonly used to store system-levelprograms that we want to have available to the computer at alltimes.

a) ROM (√)b) RAMc) Hard Diskd) CD

Q: 27). The purpose of ___________ is to act as a buffer betweenthe very limited, very high-speed CPU registers and the relativelyslower and much larger main system memory.

a) cache memory (√)b) RAMc) Virtual memoryd) ROM

Q: 28). When data are found in the cache, it is called a

a) Cache missb) Cache foundc) Cache hit (√)d) Cache data

Q: 29). By placing some parts that should be in memory insideyour hard-disk one can extend the memory capacity of acomputer way beyond what is installed; this is called ___________.a) virtual memory (√)b) cache memoryc) primary memoryd) secondary memory

Q: 30). __________ is not an input device.a) MICRb) OMRc) Touch Screend) Plotter (√)

Page 21: ITCS Assignment

Page | 21

Q: 31). ____________ is not an output device.

a) Projectorb) Printerc) Plotterd) Scanner (√)

Q: 32). All are Variants of the Mouse except.

a) Track ballb) Track padc) integrated pointing deviced) Game pad (√)

Q: 33). ____________ is a device that can read text or illustrationsand translate the information into a form the computer can use.

a) Printerb) Plotterc) Scanner (√)d) Reader

Q: 34). MICR stands for ________________.

a) Magnetic Ink Character Recognition (√)b) Magnetic Ink Character Readerc) Mechanical Ink Character Recognitiond) Mechanical Ink Character Reader

Q: 35). ___________ is not an operating system.

a) Unixb) Linuxc) DOSd) Internet Explorer (√)

Q: 36). COBOL is ___________ language.

a) 1st

b) 2nd

c) 3rd (√)d) 4th

Page 22: ITCS Assignment

Page | 22

Q: 37). ____________ converts source code into object code.

a) Compiler (√)b) Interpreterc) Translatord) Converter

Q: 38). ________________ is a software program that enables thecomputer hardware to communicate and operate with thecomputer software.

a) Application Softwareb) Translatorsc) Languagesd) Operating System (√)

Q: 39). An Operating systems that is capable of allowing multiplesoftware processes to be run at the same time is.

a) Multiuser OSb) Multiprocessingc) Multitasking (√)d) Multithreading

Q: 40). A ____________ is a language that provides little or noabstraction from a computer's instruction set architecture.

a) low-level programming language (√)b) High- level programming languagec) Assembly level programming languaged) Real programming language