By- Rudra Prasad Saha
   In computer science , control flow (or
    alternatively, flow of control) refers to the order
    in which the
    individual statements,instructions, or function
    calls of an imperative or
    a declarative program are executed or
    evaluated.
   Within an imperative programming
    language, a control flow statement is a
    statement whose execution results in a choice
    being made as to which of two or more paths
    should be followed. For non-strict functional
    languages, functions and language constructs
    exist to achieve the same result, but they are
    not necessarily called control flow statements.
   Instruction execution in a conventional
    computer is under program-flow control.
   Data is passed between instructions via
    references to shared memory cells.
   Flow of control is implicitly sequential, but
    special control operators can be used
    explicitly for parallelism.
   Program counter (PC) register is used to
    sequence the execution of instructions in a
    centralized control environment.
   Synchronous Computations are performed
    in control flow computers using centralized
    control.
Microprogram
     - Program stored in memory that generates all the control
       signals required to execute the instruction set correctly
     - Consists of microinstructions


Basic Elements of Processor
    •ALU
    •Registers
    •Internal data paths
    •External data paths
    •Control Unit
•Program Counter (PC)
   Holds address of next instruction to be fetched

•Memory Address Register (MAR)
   Connected to address bus
   Specifies address for read or write op

•Memory Buffer Register (MBR)
   Connected to data bus
   Holds data to write or last data read

•Instruction Register (IR)
   Holds last instruction fetched
•Address of next instruction is in PC
•Address (MAR) is placed on address bus
                t1:     MAR  (PC)
•Control unit issues READ command
•Result (data from memory) appears on
data bus
•Data from data bus copied into MBR
                t2:     MBR  (memory)
•PC incremented by 1 (in parallel with data
fetch from memory)
                        PC  (PC) +1          Fetch cycle
•Data (instruction) moved from MBR to IR
                 t3:    IR  (MBR)
•MBR is now free for further data fetches
1) THE SYSTEMATIZATION OF CONTROL
2) IMPROVEMENT IN PERFORMANCE
a) a high degree of parallelism in data paths e.g., multiple bit
microinstructions are
performed in one cycle
b) a high degree of decision logic (in table search and sorting routines)
3) COMPUTER-SERIES COMPATIBILITY
Compatibility of instruction sets between smaller and larger machines of a
series,
e.g., Intel286, 386, Pentium, IBM Systems/309x, Motorola 68000 series
4)Software support
Eases programing
   State the task to be performed.
   Devise a register-transfer description of the
    algorithm based on the processing section.
   Establish the design of the processing section by
    providing necessary control signals.
   Provide a block diagram of the controller section.
   Generate the state diagram of the controller
    section with different control state.
   Specify the characteristics of the hardware
    components to be used in the controller section.
   Give the complete design of the controller and
    draw a logic diagram of the final circuit.
 DATAPATH- perform
  data transfer and                       Control signals
  processing operation.
                                           Status signals
 Control Unit -
                     Control    Control
                                                            Datapath
                     inputs
  Determines the
  enabling and                                                         Data
  sequencing of the                       Control Data                 outputs

  operations
                                          outputs inputs

   The control unit receive
    the control inputs &
    generate control signals.
   Sequential – Execution of prog. statement as per
    sequence.

   Selection – A run-time choice of what to execute
    next depending on condition.

   Iteration – Repeating execution of a block of
    statements.
   Recursion –Repeatedly calling of a function or
    set of statements until no further call.
   When one
    statement occurs
    before another in
    the program, the
    first statement
    executes before
    the second,i.e as
    they appear on
    program.               Fig:sequential flow control
If there be any
condition on
execution of a
sequence of
statements, in a
program then the
control flows
depending on the
selection of the part
to be executed.
                        Fig: select max among 3 no(s)
When some block of
statements get
executed continuously
till the value of the
Loop Counter satisfies a
given condition which
controls the no of
repetition to be done, is
called Iteration.
Also known as Iterative
Loop or simply Loop.
If in a program a
function is defined
as such, so that it
will call itself until
further call does not
satisfy the condition
of recursive calling.
The function is
called Recursive
function.
•   In the control flow
    program representations
    the statement a= (b+1) *
    (b - c) is specified by a
    series of instructions
    with an explicit flow of
    control.
• Shared memory cells are the means by which data
  is passed between instructions. Data (operands)
  are referenced by their memory addresses
  (variables).
• In the traditional sequential control flow model
  (von Neumann) , there is a single thread of
  control which is passed from instructions to
  instructions.
• In control flow execution of instruction depends
  upon flow of control. But in data flow architecture
  instruction execution depends on availability of
  data token.
Flow control in computer

Flow control in computer

  • 1.
  • 2.
    In computer science , control flow (or alternatively, flow of control) refers to the order in which the individual statements,instructions, or function calls of an imperative or a declarative program are executed or evaluated.  Within an imperative programming language, a control flow statement is a statement whose execution results in a choice being made as to which of two or more paths should be followed. For non-strict functional languages, functions and language constructs exist to achieve the same result, but they are not necessarily called control flow statements.
  • 3.
    Instruction execution in a conventional computer is under program-flow control.  Data is passed between instructions via references to shared memory cells.  Flow of control is implicitly sequential, but special control operators can be used explicitly for parallelism.  Program counter (PC) register is used to sequence the execution of instructions in a centralized control environment.  Synchronous Computations are performed in control flow computers using centralized control.
  • 4.
    Microprogram - Program stored in memory that generates all the control signals required to execute the instruction set correctly - Consists of microinstructions Basic Elements of Processor •ALU •Registers •Internal data paths •External data paths •Control Unit
  • 6.
    •Program Counter (PC) Holds address of next instruction to be fetched •Memory Address Register (MAR) Connected to address bus Specifies address for read or write op •Memory Buffer Register (MBR) Connected to data bus Holds data to write or last data read •Instruction Register (IR) Holds last instruction fetched
  • 7.
    •Address of nextinstruction is in PC •Address (MAR) is placed on address bus t1: MAR  (PC) •Control unit issues READ command •Result (data from memory) appears on data bus •Data from data bus copied into MBR t2: MBR  (memory) •PC incremented by 1 (in parallel with data fetch from memory) PC  (PC) +1 Fetch cycle •Data (instruction) moved from MBR to IR t3: IR  (MBR) •MBR is now free for further data fetches
  • 8.
    1) THE SYSTEMATIZATIONOF CONTROL 2) IMPROVEMENT IN PERFORMANCE a) a high degree of parallelism in data paths e.g., multiple bit microinstructions are performed in one cycle b) a high degree of decision logic (in table search and sorting routines) 3) COMPUTER-SERIES COMPATIBILITY Compatibility of instruction sets between smaller and larger machines of a series, e.g., Intel286, 386, Pentium, IBM Systems/309x, Motorola 68000 series 4)Software support Eases programing
  • 9.
    State the task to be performed.  Devise a register-transfer description of the algorithm based on the processing section.  Establish the design of the processing section by providing necessary control signals.  Provide a block diagram of the controller section.  Generate the state diagram of the controller section with different control state.  Specify the characteristics of the hardware components to be used in the controller section.  Give the complete design of the controller and draw a logic diagram of the final circuit.
  • 10.
     DATAPATH- perform data transfer and Control signals processing operation. Status signals  Control Unit - Control Control Datapath inputs Determines the enabling and Data sequencing of the Control Data outputs operations outputs inputs  The control unit receive the control inputs & generate control signals.
  • 13.
    Sequential – Execution of prog. statement as per sequence.  Selection – A run-time choice of what to execute next depending on condition.  Iteration – Repeating execution of a block of statements.  Recursion –Repeatedly calling of a function or set of statements until no further call.
  • 14.
    When one statement occurs before another in the program, the first statement executes before the second,i.e as they appear on program.  Fig:sequential flow control
  • 15.
    If there beany condition on execution of a sequence of statements, in a program then the control flows depending on the selection of the part to be executed. Fig: select max among 3 no(s)
  • 16.
    When some blockof statements get executed continuously till the value of the Loop Counter satisfies a given condition which controls the no of repetition to be done, is called Iteration. Also known as Iterative Loop or simply Loop.
  • 17.
    If in aprogram a function is defined as such, so that it will call itself until further call does not satisfy the condition of recursive calling. The function is called Recursive function.
  • 18.
    In the control flow program representations the statement a= (b+1) * (b - c) is specified by a series of instructions with an explicit flow of control.
  • 19.
    • Shared memorycells are the means by which data is passed between instructions. Data (operands) are referenced by their memory addresses (variables). • In the traditional sequential control flow model (von Neumann) , there is a single thread of control which is passed from instructions to instructions. • In control flow execution of instruction depends upon flow of control. But in data flow architecture instruction execution depends on availability of data token.