Professional Documents
Culture Documents
DLD 5
DLD 5
(EC 104)
4/9/2024 2
Course Outline
4/9/2024 3
Course Text and Materials
4/9/2024 4
Digital systems
• Control functions
• Initiate the sequence of operations
• Consist of timing signals that sequence the operations one at a
time.
• Binary variable
• One binary state initiates an operation.
• Other binary state inhibits the operation.
• To be described is simple.
• However, no standard symbology exists for a
register-transfer language (RTL). (different sources
different conventions)
4/9/2024 13
Types of Micro-operations
• Inter-register transfer micro-operations
• Do not change the information content
• Binary information moves from one register to another.
• Arithmetic micro-operations
• Perform arithmetic on numbers stored in registers.
• Logic micro-operations
• Perform operations such as AND or OR on individual
pairs of bits stored in registers.
• Shift micro-operations
• Specify operations for shift registers.
Binary Information types
• Numerical data
• Binary numbers or binary-coded decimal numbers
• Used in arithmetic computations.
• Non-numerical data
• Alphanumeric characters or other binary-coded symbols
used for special applications.
• Instruction codes, Addresses and other control
information
• used to specify data processing requirements in the system.
Inter-register Transfer
• Registers
• designated by capital letters to denote the function of the
register.
• Eg: MAR for memory address register in memory unit.
• Other designations: A, B, R1, R2, IR etc.
𝐴←𝐵
• Denotes transfer of contents of B into A.
• Replacement of contents of A.
• Contents of B do not change.
• Control function
• Condition that determines when transfer is to occur.
• Boolean function (equal to 1 or 0)
• Terminated with a colon
𝑥 ′ 𝑇1 : 𝐴 ← 𝐵
Symbolizes: Transfer be executed by hardware only when
𝑥 ′ 𝑇1 = 1
Hardware implementation
𝑥 ′ 𝑇1 : 𝐴 ← 𝐵
• 𝑇3 : 𝐴 ← 𝐵, 𝐵←𝐴
• Swaps the contents of A and B during the same clock pulse.
• Possible in registers with Master-slave or edge-triggered FFs.
• M designates a memory word, register inside the square
brackets provides the address for memory.
Information from 2 sources
𝑇1 : 𝐶 ← 𝐴
𝑇5 : 𝐶 ← 𝐵
• Connection of 2 sources to same destination requires a
multiplexer circuit to select between 2 possible paths.
• 6 data paths
• Each register requires a multiplexer to select b/w 2
sources.
• If each register has n FFs
• 6n lines and 3 multiplexers.
Transfer through one common line
• Multiplexer
• Selects source register for bus.
• n bits n multiplexers (n-line bus).
• Decoder
• Selects destination register to
transfer information from source.
• 𝐶←𝐴
• Select A for bus (Select source=00)
• Select C for destination
(select destination= 10 ,
decoder enable=0 )
Memory Transfer(with MAR)
• Read operation
• 𝑅: 𝑀𝐵𝑅 ← 𝑀
• R is the control function that initiates Read operation.
• M is memory register specified by MAR.
• Write operation
• 𝑊: 𝑀 ← 𝑀𝐵𝑅
• W is the control function that initiates the Write operation.
Memory unit that communicate with multiple
registers
• Write operation
• 𝑊: 𝑀[𝐴1] ← 𝐵2
• Read operation
• R: 𝐵0 ← 𝑀[𝐴3]
4/9/2024 29
Register Transfer Logic
Logic Micro operations
4/9/2024 30
Register Transfer Logic
Shift Micro operations
4/9/2024 31
Register Transfer Logic
Conditional Control Statements
4/9/2024 32
Signed Binary Numbers
• In ordinary arithmetic negative value is indicated by a
minus sign.
• Due to hardware limitations, computers must represent the
sign too using ‘0’ or ‘1’.
• Signed-Magnitude system:
• MSB represents the sign.
• 0 for positive and 1 for negative
• Eg: Positive 12 is 01100 and negative 12 is 11100.
• In implementing the signed-magnitude addition and
subtraction for n-bit numbers, the single sign bit and n-1
magnitude bits are processed separately.
• Magnitude bits are processed as unsigned binary numbers.
• Subtraction thus involves correction step.
Signed Complement system
• Avoids the correction step.
• A negative number is indicated by its complement.
• A signed positive number starts with a ‘0’ in the
leftmost position.
• The complements starts with ‘1’, indicating a negative
number.
• 2’s complement is most common.
• Eg: 12 with 8 bits
• +12: 00001100
• -12: 11110100
Singed Magnitude vs Signed complement
• Take the 2’s complement of the subtrahend (N) and add the two numbers,
including the sign bit.
• ±A − +B = ±A + −B
• ±A − −B = ±A + (+B)
Signed Compliment System
Signed Compliment System
Register Transfer Logic
Fixed Point Data
• Signed Binary Number
4/9/2024 40
Register Transfer Logic
Fixed Point Data
4/9/2024 41
Overflow
• To obtain the correct answer when adding and subtracting, ensure
that the result has sufficient number of bits to accommodate the sum.
• If the sum of two n-bit number results in a n+1 bit number, an
overflow occurs.
• Overflow is a problem in computers as the number of bits to
represent a number is fixed.
• A result which exceeds the number of bits cannot be accommodated.
• Computers detect and signal the occurrence of overflow.
• Overflow condition may be handled automatically by interrupting
the execution of the program and taking special action. Or overflow
condition can be monitored using software.
• In unsigned addition overflow is indicated by the carryout of MSB.
• In unsigned subtraction the magnitude of the result is always less
than or equal to the larger of the original numbers: overflow is
impossible.
Overflow in signed complementary numbers
• T: A←A + B, V ← Cn (xor) Cn + l
Arithmetic Shifts
4/9/2024 47
Register Transfer Logic
Arithmetic Shift
4/9/2024 48
Register Transfer Logic
Floating Point Data
4/9/2024 49
Register Transfer Logic
Floating Point Data
4/9/2024 50
Non-numeric data
• Masking
• Inserting
XOR micro-operation for complementing
• An instruction code is a group of bits that tell the computer to perform a specific operation.
4/9/2024 59
Part (a)
• consists of
• a memory unit:
• 256 words of 8 bits each
• Instructions and data are stored in the
memory unit,
• seven registers: all information
processing is done in the registers
• two decoders
• qi: one o/p for an operation code.
• ti: Timing variables from counter T
4/9/2024 68
Registers in simple computer
Instructions for a simple computer
• MOV: Move
• LDI: Load immediate
• LDA: Load into A
Instruction fetch cycle
• 𝑞1 𝑡3 : 𝐴 ← 𝑅, 𝑇 ← 0
4/9/2024 81
Design of Arithmetic Logic Unit
4/9/2024 82
Design of Arithmetic Logic Unit
4/9/2024 83
Design of Arithmetic Logic Unit
4/9/2024 84
Control Logic Design
• PLA Control
• Micro Program Control
• Hardwired control
• Control of Processor Unit
4/9/2024 85
Control Logic Design
• PLA Control
4/9/2024 86
Control Logic Design
• Micro Program Control
4/9/2024 87
Control Logic Design
• Hard Wired Control
4/9/2024 88
Control Logic Design
1. Problem Statement
2. Equipment Configuration
4/9/2024 89
Control Logic Design
4. Algorithm Formulation
4/9/2024 90
Control Logic Design
4. Data Processor Specification
4/9/2024 91
Control Logic Design
4. Control State Diagram
4/9/2024 92
Control Logic Design
Control of Processor Unit
4/9/2024 93
Control Logic Design
Control of Processor Unit
4/9/2024 94