Ugc Net: Computer Science and Applications
Ugc Net: Computer Science and Applications
Eduncle.com
Mpa 44, 2nd Floor, Above Bank Of India, Rangbari Main Road,
Toll Free: 1800-120-1021
Mahaveer Nagar 2nd, Near Amber Dairy, Kota, Rajasthan, 324005
Website: www.eduncle.com | Email: Info@Eduncle.com
Computer System Architecture
Computer Architecture :
Computer Architecture defines the system in an abstract manner.
It defines low level concepts / logical units.
It defines the concept that the programmer deals with directly.
This consider ‘what’ does the system do.
It deals with those units which are directly concerned to the programmers like types of
instructions, addressing modes, data types etc.
Registers :
(i) Registers are the memory units.
(ii) Registers store, accept and transfer data and instructions that are being used immediately.
Register Transfer : It means transfer the content of one register to another register or in the
same register. This express by the Register Transfer Language (RTL).
Note : The operations on the data in registers are called micro operations.
Register Transfer Language (RTL)
RTL used to express the design process of the digital systems.
It is a symbolic language.
It is a tool for describing the internal organization of digital computers.
For Example : R2 R1 , R1 and R2 denoting the registers
It denotes transfer the content of R1 into register R2.
Example : P : R 2 R1 this indicates if the value of P is 1 then transfer the content of R1 into
R2.
RTL Symbols :
(i) Letters and numerals
Description – Denote a register Ex.: R2 MAR etc.
(ii) Parentheses Description – Denote a part of a register Ex.: R1(0 – 7)
(iii) Arrow Denotes transfer of data R3 R2
(iv) Comma, Denotes the separation of two micro operations.
Ex.: R3 R2, R4 R1
(v) Colon : Terminates Control Conditions P : R3 R2
Ex.: F : R4 R3, R3 R4
Above RTL show an operation that exchanges the content of R3 and R4 during one
common clock pulse when F = 1.
Bus : Bus refers to a group of wires which is used for transferring information from one part of
computer system to another.
Bus Transfer : For Example : Bus C, R4 Bus.
This shows content of register C is placed on the bus, and then bus content is loaded into R4
register.
Bus Types
Internal External
Internal Bus : It connects all the internal computer components to the CPU and main memory.
It is also called as system Bus.
External Bus : It connects the external devices with the computer system.
There are some commonly used buses are also that are as follows :
(a) Data Bus : The data bus is used to transfer the data, from CPU to memory, or memory
to CPU. It is bidirectional bus.
(b) Address Bus : This is used to transfer information about where the data should go. It is
unidirectional CPU is addressing a specific location where data should be go.
(c) Control Bus : This bus is used to transmit the information which are necessary to control
and coordinate the operation of the computer. It transmits variety of individuals signals
(read, write, interrupt, etc.) to control and coordinate the operation of the computer.
Memory Transfer
(i) Memory Read : Transfer of information from memory to outside world is called memory
read.
(ii) Memory Write : Transfer of new information to be stored into the memory is write operation.
Example : Memory Read : Read : DR M[AR]
DR Data Register AR Address Register
M[AR] Denotes memory location of AR.
Memory Write : Write : M[AR] R1
Store R1 register content to memory location of address register M[AR].
Memory Address Register (MAR) : It is used to store the address of the memory location. It
is address register.
Memory Data Register (MDR) : It is used to store the data on which operation is being performed.
It is data register.
Arithmetic Micro-operations
These micro operations perform arithmetic operations on numeric data stored in registers.
Binary Incrementer : This micro operation adds one to a number in a register. This micro
operation is implemented by binary counter.
Half adder combinational circuit is used for implementing binary incrementer. Half adders are
connected in cascade to implement binary incrementer.
Logic Microoperations
These microoperations consider each bit of register and treated them as binary variables.
AND, OR, NOT, XOR these microoperations are used by computer, and other logic microoperations
are derived from these four microoperations.
Selective Set Micro-Operation : This logic microoperation set 1 the bits in register D where
there are corresponding is in register E.
1010 D before
1100 E (logic operand)
Example :
1110 A After
Example :
Selective complement is nothing but ex-or operation it says if both digit are same then output
is zero otherwith 1.
A A 0/P
same
1 1 0
1 diff. 0 1 0100
1 same 1 0
0 same 0 0
A 1 1 1 0
B 0 1 0 0
Example :
0/P 1 0 1 0
Selective Clear : A • B’
• and operation
B’ complement of B
A B B' A B'
1 0 1 1
1 1 0 0 1010
1 0 1 1
0 0 1 0
A 1 1 1 0
B 0 1 0 0
0 1 0 0 after marking
0 0 0 0 1 0 1 0
1 0 0 1 0 0 0 0
1 0 0 1 1 0 1 0 Final result of insert operation
Shift Micro-Operation
Shift micro-operations are used for serial transfer of data.
The content of the registers can be shifted to the left or right.
There are three shift micro-operation :
(i) Logical Shift (ii) Arithmetic Shift
(ii) Circular Shift
(i) Logical Shift :
(a) Right Logical Shift : R Shr R
0 1 1 0 1 1 0 1 8 bit register
0 1 1 0 1 1 0 1 8 bit register
0 1 1 0 1 1 0 1 8 bit register
0 1 1 0 1 1 0 1 8 bit register
Components of a Computer
Input Unit
CPU
15 12 0
So, Opcode Address
2 4096
2 2048 0
2 1024 0
2 512 0
2 256 0
2 128 0
2 64 0
2 32 0
2 16 0
2 8 0
2 4 0
2 2 0
1 0
(Memory)
Instruction (program)
Operands (data)
Pr ocessor Re gister
(Accumulator OR AC)
Solved Question :
Q. Any instruction should have at least :
(A) 2 operands (B) 1 operand
(C) 3 operands (D) None of above
Ans. (B) 1 operand
Computer Register
Registers are memory units which stores the data which is use frequently because registers are
fast storage devices, there storage capacity is much less but there speed is very fast.
Types of Registers : Registers resides in CPU. There are various computer registers that
stores specific content.
(a) Data Register (DR) Holds data (or operands)
(b) Address Register (AR) Holds address of data or operand
(c) Accumulator (AC) Processor Register
(d) PC program counter Holds address of next instruction
(e) Input register (INPR) Holds input character
(f) Output register (OUTR) Hold output character.
Contact Us : Website : www.eduncle.com | Email : support@eduncle.com | Call us : 7665435300 7
Computer Science and Applications (Sample Theory)
Ex.: The register which holds the address of the next instruction :
(A) Address Register (B) Data Register
(C) Program Counter (D) Accumulator
Ans. (C) Program Counter
Computer Instructions
There are three instruction code formats in general purpose computers :
(a) Memory Reference Instruction
(b) Register Reference Instruction
(c) Input Output Instruction
Each instruction format is of 16 bits.
(a) Memory Reference Instruction
From 16 bits opcode (operation code) 3 bits
(Number of bits specify) Address 12 bits
Remaining 1 bit specify direct address or indirect address 0 direct address, 1 indirect
address.
Direct Address : Instruction format have two parts opcode and address, if address part shows
the address of a operand then it is a direct address.
Indirect Address : If address part of instruction format specify an address of a memory word
in which the address of operand is found, called indirect address.
Example : Instruction format is 457 indicates address of operand. At 457 find the operand. 15th
bit is 0 for direct address.
15 14 1211 0
0 ADD 457
16 bit
0 ADD 457
457 Operand
15 14 1211 0
1 ADD 200
(Instruction format)
Location 200 specifies the address of operand, (for example it is 1000) at location 1000 we found
the operand in indirect address.
Direct Address :
15 14 1211 0
0 Opcode Address
15 14 1211 0
1 Opcode Address
15 14 1211 0
Example : 0 111 Re gister Operation
15 14 1211 0
Example : 1 111 I / O Operation
Timing and Control : The events which are occur into the computer system are occur on time,
there is a master clock generator which controlled the timing for all the registers in CPU.
Timing signals or clock pulses are applied to every registers in the control unit.
Control signals are used to enable the registers so that clock pulses change the state of
the registers. Control signals are generated by the control unit.
Control signals indicates whether a data is read into or written out to memory, whether
CPU is accessing memory of I/O device, and whether I/O device or memory is ready to
transfer data.
Fetch
Interrupt Decode
Execute
Interrupt
CPU is currently executing a process, user requesting a new process then the disturbance is
occurred it is called an interrupt.
Three Types of interrupts -
(a) Internal Interrupt (occurs due to some problem in execution)
(b) External Interrupt (occurs when CPU is executing the instructions and that time some
I/O operation will occur)
(c) Software Interrupt (occurs when while we are processing some instructions and that time
execute a one more new application program).
(d) Maskable Interrupt – Ignored by CPU.
(e) Non Maskable Interrupt – Not Ignored by CPU.
Machine Language
(i) Machine language written as combination of 0 bit and 1 bit. For example 01110, 1110,
11100010
(ii) It is machine dependent.
(iii) Every statement written in machine language is machine dependent.
Assembly Language : In this language some english words are used to represent the operation
performed by the instructions. These english words are called mnemonic.
For Example : ADD Format ADD A, B
Add A and B places the result in A.
LDA Load operation
LDA M The content of memory M to AC.
AC Accumulator
STA M Store the content of AC to accumulator (AC).
Mnemonics are used to written machine instructions.
Assembler : It is a system software which converts the assembly language program to
machine language.
Assembly language Program Assembler Machine Language
Program Control Instruction in Assembly Language
These instructions are used to change or modify the flow of program, through these instructions
flow of program can be modify or change. For Example :
(i) JMP (ii) CALL
(iii) HLT (iv) MOVE
(v) JOV (Jump on Overflow)
(vi) LOOP etc.
The two types of program control instructions are :
1. Unconditional : These instructions execute always.
Example : CALL, RET, JUMP, LOOP etc.
2. Conditional : These execute only when the specified condition is true.
Example : JC, JNC, JZ,JNZ,JO,JNO etc.
(1) Unconditional Program Control Instructions :
Opcode Operand Explanation Example
CALL Address It calls the subroutine CALL 205
and saves the return
address on the stack
RET NO Operand Returns from the RET
subroutine to main
program
JUMP Address It transfers the control of JUMP 205
execution to the
specified address
LOOP Address loops through a LOOP 205
sequence of instructions
until CX=0
CX is the register
Ex. Which category of microprocessor instructions detect the status conditions in registers and
accordingly exhibit the variations in program sequence on the basis of detected results?
(A) Transfer Instructions (B) Operation Instructions
(C) Control Instructions (D) All of the above
Ans. (C) Control instruction
Program Loops
A program loop is a sequence of instructions that are executed many times each time with a
different set of data.
Program Loops are specified by the FORTRAN by a
Do statement.
DIMENSION A(100)
INTEGER SUM, A
SUM = 0
Do 3 J = 1, 100
3 SUM = SUM + A(J)
There are two types of program loops finite and infinite loops. Finite loops are terminated on some
conditions, infinite loops are not terminated.
Subroutines : It is a block of instructions which perform a specific and well defined task is called
a subroutine. Subroutines are written and stored separately.
Subroutine can -
(i) Half the main program
(ii) Provide returning to the same point
(iii) Transfer control to subroutine
(iv) Execute the subroutine
(v) Revert to the main program
The link between subroutine and main program is the BSA (branch and save return address)
instruction is used.
To understand the microprogrammed control unit components, see the diagram below :
MUX
CMAR
M=1
CONTROL
MEMORY
(ROM)
M BA
CF
(Control Field)
CMAR (Control Memory Address Register) : It tells the address of control memory which
is to be read.
Through control memory we take control signals which are put in control field (CF), this
is a part of output register, one part of output register contains BA (Branch Address).
Branch Address is an address of next address in the control memory which should be
read.
External Address generator identifies, the address of the next instruction to be executed.
There are two inputs of multiplexer (MUX), one is Branch address and other from External
Address Generator.
So there is a selection mechanism for it if M = 0 then address is generated through
External Address Generator and if M = 1 address is generated from Branch address.
One of the systems One of the systems Control signals Next Instruction
supported branch supported flags Log 2 Decoded binary address
condition Log 2 (No. (No. of flages) format (1 bit/CS) Log 2 CM size
of Branch conditions) Encoded binary
format
(N CS’s log2 N bits)
Fig. Microinstruction control word format
Microprogram Sequencer : This is a set of components which are taking part to determine
which the next location in control memory to read is. In MCU control memory is not a part of microprogram
sequencer.
C5 C4 C3 C2 C1 C0 B A M
0 0 0 0 1 1 0 1 1
0 1 1 1 0 0 0 2 1
1 0 0 0 0 1 x x 0
In MCU (Micro Programmed Control Unit) if we change the sequence of control signals in control
memory without any modifications in hardwired or circuit we can change the sequence of micro operations,
so that’s why micro programmed control unit is more flexible.
Disadvantage : It have low speed as compare to harwired control unit.
Design of Control Unit
Functions of Control Unit
1. The control unit is a component of CPU that directs the operations of the processor.
2. It tells the computer’s memory, ALU and input / output devices how to respond to a
program’s instructions.
Contact Us : Website : www.eduncle.com | Email : support@eduncle.com | Call us : 7665435300 16
Computer Science and Applications (Sample Theory)
3. It directs the operation of the other units by providing timing and control signals.
4. It generates the control signals to perform the operations.
Components of Control Unit
1. Sequence logic (It generates a logic in which sequence the operations have to the executed)
2. Registers
3. Decoder
4. Control Memory (Stores control signals)
Control Unit
Sequencing
Logic
Registers and
Decoders
Control
Memory
Main Memory
2. To construct Binary Adder - Subtractor which Logic Gate is include with each full adder. :
(A) OR-Gate (B) NOT-Gate
(C) Exclusive NOR Gate (D) Exclusive OR GATE
6. Which of the following cycle is used for interpreting the instruction that was fetched in the fetch
cycle?
(A) Fetch cycle (B) Decode cycle
(C) Execute cycle (D) Interrupt cycle
7. The register which contains the data to be written into or read out of the addressed location is
called :
(A) Memory addressed register (B) Memory Data register
(C) Program counter (D) Index register
9. How many 32 K × 1 RAM chips are needed to provide a memory capacity of 256 KB ?
(A) 8 (B) 32
(C) 64 (D) 128
10. Comparing the time T1 taken for a single instruction on a pipelined CPU with time T2 taken on
a non-pipelined but identical CPU we can say that :
(A) T1 T2
(B) T1 T2
(C) T1 T2
(D) T1 is T2 plus line taken for one instruction fetch cycle
SOLUTIONS