Professional Documents
Culture Documents
SAGE
(Air Force, 1958)
1
Moore’s Law If Automobile Industry follows Moore’s Law..
Gordon Moore,
Intel Corporation
2
Summary Points
• Binary Codes for Numerical Information
– Unsigned-binary code: represents only positive
EEL 4744C: Microprocessor Applications information
– Singed/magnitude binary code
– One’s-complement code
Lecture 1 – Two’s-complement code and arithmetic
– Binary coded decimal
Lecture 1
Unsigned
Mnemonic binary
Part 3 (used by code
Assembly (used by
Microprocessor Architecture Code) Machine
Code)
3
Hardware for I/O Hardware for I/O (2)
• Input: • Assume 4 input and 4 output devices:
– 8 switches, or more choices, i.e. an A/D converter? – Operand code is needed to specify one of 4 I/O devices
– Append this operand code to the op code
• Output: – We now have 8-bit instruction codes
– Input device number is encoded with “ii”
– 8 LED’s, or more choices, i.e. an D/A converter?
– Output device number is encoded with “oo”
• Design options for input: • The MOV operations:
– Use 2 input operations, IN1 (switches) and IN2 (A/D) – Input into accumulator A, output from accumulator A
– Include the operand with the operation => instruction – Need to move number from A to B
– Define MOV to transfer data from A to B
• Instruction = operation + operand – MOV copies data from source (A) to destination (B)
– What is to be done, and what is to be operated on – Need to add 1 more bit to the Op Code
No need
to specify Assembly
operands Code Sequence
4
Example Program (2) Instruction Register & Decoder
• When an instruction is fetched from the computer
memory, its is transferred to an instruction register and
decoder
• The instruction register holds the instruction, the
decoder then decode the instruction
– The decoder is a combinational logic circuit
– It takes the op code bits from the instruction and generates
logic signals that are asserted for each operation
– These logic signals go to appropriate places in the computer
0 01
Asserted signal
Control signal
5
Instruction Execution Cycle Sequential State Machine
• The sequence of steps the processor goes through to
do the complete instruction and to get ready for the
next, until the program is finished or stopped
• Specific steps (simplified)
– IF: instruction fetched
Partition instruction
– ID: instruction decoded, control signals asserted
execution into smaller State transition
– RT/EX: register transfer and/or execution work unit. Each work diagram is used to
– PC: increment program counter unit can complete generate control
within a single clock signals at given
• These steps are repeated for each instruction execution cycle. clock cycle.
cycle until the program is done, or until something is
done to make the program stop A sequential state transition diagram
Dr. Tao Li 31 Dr. Tao Li 32
6
I/O Synchronization & Wait State I/O Synchronization & Wait State (2)
• How do we make the computer “wait for” human input,
e.g. entering data from outside?
• How do you make the computer wait for you when you
input those 2 numbers?
I/O Synchronization & Wait State (3) MOV that uses 2 Registers
• How about the OUT instruction? Should it have a Wait • MOV dd, ss (dd) (ss)
state also?
• Moves data from (ss) source register to (dd)
• The READY signal for OUT can be asserted when the
output device has received the data
destination register
7
Control Instructions Control Instructions (2)
• HALT • Conditional branch
– Stops the clock pulses going into the sequence controller
– Condition code (RC) register contains bits which are
• JMP or BRA set or reset when an ALU operation is performed
– Transfers the PC from one place of the program to another
– Operand is the memory location from which the computer must – A RC register can hold flip-flops for carry, zero,
fetch its next instruction negative, two’s complement overflow, odd/even
– This is a 3-byte instruction parity
• Example: “unconditional branch”: BRA 15 – The RC register bits are connected to the sequence
controller
First byte: Op Code
Second byte: (branch address) – We can then design branch-if-carry, branch-if-
Third byte: (branch address) overflow, etc.
Dr. Tao Li 45