# KCPSM6 Instruction Set

Save this PDF as:

Size: px
Start display at page:

## Transcription

3 AND, kk AND, sy The AND instructions perform the bit-wise logical AND operation. The first operand must specify a register whose value provides one input to the AND operation and in to which the result is returned. The second operand defines the second input to the AND operation and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if all 8-bits of the result returned to are zero. The carry flag () will be cleared (=) in all cases. sy or kk AND, kk = AND kk AND, sy = AND sy Examples =? Reference LOAD sa, A AND sa, 53 LOAD sa, A AND sa, 4 sa = 42, =, =. sa =, =, =. A = 53 = A AND 53 = = 42 A = 4 = A AND 4 = = A B A AND B AND s, F Hint This instruction will clear the upper nibble of s and preserve the lower nibble. This could be used to convert the ASII characters to 9 (3 to 39 hex) into their equivalent numerical values ( to 9 hex). Page 56

4 OR, kk OR, sy The OR instructions perform the bit-wise logical OR operation. The first operand must specify a register whose value provides one input to the OR operation and in to which the result is returned. The second operand defines the second input to the OR operation and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if all 8-bits of the result returned to are zero. The carry flag () will be cleared (=) in all cases. sy or kk OR, kk = OR kk OR, sy = OR sy Examples =? Reference LOAD sa, A OR sa, 53 LOAD sa, A OR sa, 4 sa = DB, =, =. sa = DE, =, =. A = 53 = A OR 53 = = DB A = 4 = A OR 4 = = DE A B A OR B OR s, 3 Hint This instruction will set bits4 and bit5 of s and preserve all other bits. This could be used to convert the numerical values to 9 hex into their ASII equivalent characters to 9 (3 to 39 hex). Page 57

5 XOR, kk XOR, sy The XOR instructions perform the bit-wise logical exclusive-or operation. The first operand must specify a register whose value provides one input to the XOR operation and in to which the result is returned. The second operand defines the second input to the XOR operation and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if all 8-bits of the result returned to are zero. The carry flag () will be cleared (=) in all cases. sy or kk XOR, kk = XOR kk XOR, sy = XOR sy Examples =? Reference LOAD sa, A XOR sa, 53 LOAD sa, A XOR sa, 4 XOR s, OUTPUT s, 8 XOR s, OUTPUT s, 8 Page 58 sa = 99, =, =. sa = DE, =, =. A = 53 = A XOR 53 = = 99 A = 4 = A XOR 4 = = DE A B A XOR B Hint The XOR instruction can be used to toggle the state of bits within a register. In this example the least significant bit of s is twice toggled and output to a port. Assuming the LSB was to begin with then this will have generated a positive ( ) pulse on the LSB of the output port whilst all other bits remained unaffected.

8 SUB, kk SUB, sy The SUB instructions perform the arithmetic subtraction of two 8-bit values and set the carry and zero flags according to the result. The first operand must specify a register from which the second operand will be subtracted and to which the result is returned. The second operand defines the value to be subtracted from the first operand and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if the 8-bit result returned to is zero. The carry flag () will be set if the result of the subtraction is negative. Hence the carry flag represents an underflow or a borrow to complete the operation. SUB, kk = - kk SUB, sy = - sy sy or kk Set if result < =? Examples LOAD sa, 8E SUB sa, 43 LOAD sa, 8E ADD sa, sa 8E - 43 = 4B sa = 4B which is not zero (=) and with no underflow (=). 8E - 8E = sa = which is zero (=) but there was no underflow (=). LOAD sa, 8E SUB sa, B5 Page 6 8E B5 = D9 sa = D9 which is not zero (=) but there was an underflow (=). This is equivalent to 42 8 = -39 where D9 hex is the twos complement representation of -39. However, it is the users responsibility to implement and interpret signed arithmetic values and operations.

9 SUBY, kk SUBY, sy The SUBY instructions are primarily intended as an extension to the basic SUB instructions in order to support arithmetic subtraction of values more than 8-bits. The key difference from the SUB instructions is that the zero and carry flags are also used as inputs to the subtraction function and these can influence both the 8-bit result and the new states of the flags. Although each register only contains an 8-bit value, any combination of registers can be used to hold larger values segmented into bytes. For example a 32-bit value can be held in a 4 registers. Although there is no restriction on which registers, and no formal way of describing the assignment, it is common practice to assign adjacent registers and refer to them as a register set such as [sd, s, sb, sa]. The first operand must specify a register from which the second operand and carry flag will be subtracted and to which the result is returned. The second operand defines the value to be subtracted from the first operand and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if the 8-bit result returned to is zero and the zero flag was set prior to the SUBY instruction. The carry flag () will be set if the result of the subtraction is negative. Hence the carry flag represents an underflow or a borrow to complete the operation. SUBY, kk = - kk - SUBY, sy = - sy - sy or kk k k k k k k k k arry from previous operation Examples Set if result < The key observation to make as illustrated by these examples is that carry and zero flags reflect the entire result of a multi-byte subtraction. In particular, the zero flag is only set if the complete multi-byte result is zero and is not just based on the 8-bit result of the final SUBY operation. AND =? =? ero from previous operation LOAD sa, 7B LOAD sb, A2 SUB sa, B9 SUBY sb, A [sb, sa] = A2 7B - A B9 = 2 7B B9 = (-)2 sa = 2, =, =. A2 A - = sb =, =, =. LOAD sa, 7B LOAD sb, A2 SUB sa, sa SUBY sb, sb [sb, sa] = A2 7B - A2 7B = 7B 7B = sa =, =, =. A2 A2 - = sb =, =, =. Page 62

10 TEST, kk TEST, sy The TEST instructions are similar to the AND instructions in that a bit-wise logical AND operation is performed. However, the actual result is discarded and only the flags are updates to reflect the temporary 8-bit. The TEST instruction also reports then exclusive-or of the temporary result which can be used to compute the odd parity of a value. The first operand must specify a register whose value provides one input to the AND operation ( will not be effected by the operation). The second operand defines the second input to the AND operation and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if all 8-bits of the temporary result are zero. The carry flag () will be set if the temporary result contains an odd number of bits set to (the exclusive-or of the 8-bit temporary result). TEST, kk temp = AND kk Hints TEST, sy temp = AND sy sy or kk It is typical to think of containing the information to be tested and for sy or kk to be acting as a bit-mask to select only those bits to be tested. To test a single bit the value of kk is best described using a binary format such as b that will text bit 5 (equivalent to 2 hex). The flag will be set if the corresponding bit in is and the flag will be set if the tested bit is. Use a mask value of kk = FF to compute the odd parity of the whole byte contained in. Examples LOAD sa, A TEST sa, b =, = (odd). temp A = 4 = A AND 4 = = =? Odd? 3 2 LOAD sa, 5 TEST sa, FF =, =. Parity is odd. 5 = FF = 5 AND FF = = 5 Hint The SLA and SRA shift instructions and the ADDY and SUBY instructions can all be used to move the value of the carry flag into a register. Page 63

11 TESTY, kk TESTY, sy The TESTY instructions are primarily intended as an extension to the basic TEST instructions in order to support testing and odd parity calculation of values more than 8-bits. The key difference from the TEST instructions is that the zero and carry flags are also used as inputs that can influence the new states of the flags. Although each register only contains an 8-bit value, any combination of registers can be used to hold larger values segmented into bytes. For example a 32-bit value can be held in a 4 registers. Although there is no restriction on which registers, and no formal way of describing the assignment, it is common practice to assign adjacent registers and refer to them as a register set such as [sd, s, sb, sa]. The first operand must specify a register whose value provides one input to the AND operation ( will not be effected by the operation). The second operand defines the second input to the AND operation and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if all 8-bits of the temporary result are zero and the zero flag was set prior to the TESTY instruction. The carry flag () will be set if the temporary result together with the previous state of the carry flag contains an odd number of bits set to. TEST, kk temp = AND kk TEST, sy temp = AND sy sy or kk The meaning of the and flags are the same following a TEST and TESTY combination of instructions used to test and compute the odd parity of a multi-byte value as they are after a single 8-bit TEST operation. temp Examples LOAD sa, A LOAD sb, 52 TEST sa, FF TESTY sb, FF [sb, sa] = 7 bits in total are so parity is odd. =, =. AND =? =? ero from previous operation LOAD sa, A LOAD sb, 52 TEST sa, b TESTY sb, b [sb, sa] = Both bit3 and bit3 of the 6-bit word are. =, = (even). Odd? arry from previous operation Page 64

12 OMPARE, kk OMPARE, sy The OMPARE instructions perform the arithmetic subtraction of two 8-bit values but the actual result is discarded and only the carry and zero flags are updated according to the temporary result. The first operand must specify a register from which the second operand will be subtracted (the value of will not be effected by the operation). The second operand defines the value to be subtracted from the first operand and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if the temporary 8-bit result is zero corresponding with both operand being equal or matching. The carry flag () will be set if the temporary result of the subtraction is negative and hence indicating when is less than the second operand. Flag States omparison OMPARE, kk temp = - kk OMPARE, sy temp = - sy sy or kk x Examples LOAD sa, 8E OMPARE sa, 8E JUMP, equal > kk or > sy x = kk or = sy LOAD sa, 8E OMPARE sa, 98 JUMP, less_than < kk or < sy Values are equal, =, =. sa < 98, =, =. Hints Set if temp < Use to determine when the values are equal or match. temp =? The flag can be used to determine when is less than the second operand. Hence, it can also be used to determine when is greater than or equal to the second operand. So when comparing the contents of two registers assign them to and sy such that you can use to identify which is less. This will avoid the requirement to test both and flags. The KSPSM6 Assembler enables you to specify constants in hex, decimal and ASII characters, e.g. OMPARE s, Q Page 65

13 OMPAREY, kk OMPAREY, sy The OMPAREY instructions are primarily intended as an extension to the basic OMPARE instructions in order to support comparison of values more than 8-bits. The key difference from the OMPARE instructions is that the zero and carry flags are also used as inputs to the subtraction used to perform the comparison and these can influence both the 8-bit result before it is discarded and the new states of the flags. Although each register only contains an 8-bit value, any combination of registers can be used to hold larger values segmented into bytes. For example a 32-bit value can be held in a 4 registers. Although there is no restriction on which registers, and no formal way of describing the assignment, it is common practice to assign adjacent registers and refer to them as a register set such as [sd, s, sb, sa]. The first operand must specify a register from which the second operand and carry flag will be subtracted ( will not be effected by the operation). The second operand defines the value to be subtracted from the first operand and can either be an 8-bit constant kk or a register sy. The zero flag () will be set if the temporary 8-bit result is zero is zero and the zero flag was set prior to the OMPAREY instruction. The carry flag () will be set if the temporary result of the subtraction is negative. OMPAREY, kk temp = - kk - OMPAREY, sy temp = - sy - Examples Set if temp < temp The meaning of the and flags are the same following a OMPARE and OMPAREY combination of instructions used to compare multi-byte values as they are after a single 8-bit OMPARE operation. AND sy or kk k k k k k k k k =? =? arry from previous operation ero from previous operation LOAD sa, 7B LOAD sb, A2 LOAD s, 4 OMPARE sa, 7B OMPAREY sb, A2 OMPAREY s, 4 JUMP, equal [s,sb, sa] = 4 A2 7B 4A27B 4A27B = Values are equal =, =. LOAD sa, 7B LOAD sb, A2 OMPARE sa, 7B OMPAREY sb, B9 JUMP, less_than [sb, sa] = A2 7B A27B B97B = (-) E9 [sb, sa] < B97B =, =. Page 66

14 SL SL SLX SLA These instructions all shift the contents of the specified register () one bit to the left. The most significant bit (MSB) is shifted out of the register into the carry flag (). The bit that is shifted into the least significant bit (LSB) is defined by the shift left instruction that is used. The zero flag () will be set only if all 8-bits of the resulting value contained in the register are zero. SL =? SL shifts a into the LSB. The flag will only be set if bits(7:) are also all after the shift. SL = SL shifts a into the LSB. This means that the flag will be always be cleared (=) by this instruction. SLX =? SLX replicates the existing state of the LSB. The flag will only be set if all 8-bits of the register are zero. SLA Previous =? SLA shifts the previous state of the carry flag into the LSB at the same time that the carry flag is loaded with the MSB. The flag will only be set if all 8-bits of the register are zero. Examples A shift left injecting a has the effect of multiplying a value by 2. The SLA instruction enables multi-byte values contained in multiple registers to be shifted. LOAD sb, 4 LOAD sa, B5 SL sa SLA sb LOAD sf, b loop: OUTPUT sf, port SLX sf JUMP N, loop Page 67 [sb,sa] = 4B5 = 53 = [sb,sa] = 296A = 62 = Outputs a simple pattern shown on the right hand side to the to port. The process terminates when all 8-bits have been set and the final shift sets the carry flag. sb SLA sb SL sa sa

15 SR SR SRX SRA These instructions all shift the contents of the specified register () one bit to the right. The least significant bit (LSB) is shifted out of the register into the carry flag (). The bit that is shifted into the most significant bit (MSB) is defined by the shift right instruction that is used. The zero flag () will be set only if all 8-bits of the resulting value contained in the register are zero. SR =? SR shifts a into the MSB. The flag will only be set if bits(6:) are all also after the shift. SR = SR shifts a into the MSB. This means that the flag will be always be cleared (=) by this instruction. SRX =? SRX replicates the existing state of the MSB. The flag will only be set if all 8-bits of the register are zero. SRA Examples Previous =? SRA shifts the previous state of the carry flag into the MSB at the same time that the carry flag is loaded with the LSB. The flag will only be set if all 8-bits of the register are zero. A shift right has the effect of dividing a value by 2. The SRA instruction enables multi-byte values contained in multiple registers to be shifted. When 2 s complement is used to represent signed values then SRX implements sign extension. LOAD sb, ED LOAD sa, 2A SL sa SLA sb LOAD sf, b loop: OUTPUT sf, port SR sf JUMP N, loop Page 68 [sb,sa] = ED2A = = [sb,sa] = F695 = -24 = Outputs to port a simple walking pattern as illustrated on the right hand side. The process terminates when the is shifted into the carry flag. sb SRX sb sa SRA sa

16 RL RR The RL and RR instructions rotate the contents of the specified register () one bit to the left or right. The bit that is shifted out of on end of the register and back into the other end is also copied into the into the carry flag (). The zero flag () will be set only if all 8-bits of the register contents are zero. RL =? RL shifts all bits one place to the left and the MSB that is shifted out is shifted into the LSB as well as copied into the carry flag. The flag will only be set if all bits of the register are zero. RR =? RR shifts all bits one place to the right and the LSB that is shifted out is shifted into the MSB as well as copied into the carry flag. The flag will only be set if all bits of the register are zero. Note that because the rotate instructions only reorganize the existing contents of the zero flag will only be set if contained zero on entry to the rotate operation. Example Rotate operations are typically used in the generations of bit patterns or sequences such as in the control of stepper motors. LOAD s6, 3 loop: OUTPUT s6, motor_ctrl ALL step_delay INPUT s, direction TEST s, JUMP N, move_right RL s6 JUMP loop move_right: RR s6 JUMP loop In this example we can imagine a stepper motor that has 8 coils arranged in a circle such that the coil mapped to bit is adjacent to the coil mapped to bit7. The position of the motor is defined by the coils being energised and in this case it is beneficial to energise two adjacent coils of a motor at the same time (hence the initial value of 3 loaded into s6 ). An input is sampled to determine in which direction the motor should rotate and this is translated into the direction in which the pattern is rotated either to the left or right. Left Right Page 69

17 REGBANK A REGBANK B KPSM6 actually has 32 registers that are arranged into 2 banks of 6 registers called bank A and bank B. Only one bank can be active at a given time and all instructions (except STAR ) can only perform operations involving the registers is the active bank. To put it another way the registers in the inactive bank are almost completely isolated and their contents are unaffected by instructions modifying values within the registers of the active bank. Following device configuration or an active High reset pulse on the reset input of the KPSM6 macro bank A will be the active bank. Hence KPSM6 can initially be considered to have 6 registers and this will be adequate for many applications. sf se sd s Default Bank BANK A sf se sd s BANK B The REGBANK instruction can be used to select which bank is to be active and therefore assign the other bank to being inactive. There is only one carry flag and one zero flag neither of which is effected by the bank selection. sb sa s9 sb sa s9 REGBANK A - Select bank A active (or restore default bank). s8 s8 REGBANK B - Select bank B active. s7 s7 s6 s6 Hint When selecting a different bank there is no effect on the contents of any registers in either bank. However, it will almost certainly appear as if the contents of all registers change as the swap is made. Hint - If you use the NAMEREG directive in your code then you will probably want to assign different names to the registers following the REGBANK instruction to reflect that you are no longer accessing the same information. s5 s4 s3 s2 s s s5 s4 s3 s2 s s Page 7

18 STAR, sy Apart from bank A being the default on power up or following a reset you are completely free to select back A or bank B as an when you wish using the REGBANK instruction. All instructions only operate on the registers in the actively selected bank which preserves the values in the inactive bank. This is typically of value when creating a subroutine that implements an intense task where the use of many registers to manipulate data makes the task easier. It is also very appealing when servicing an interrupt as it can really help to ensure that the contents of registers being used anywhere else in the program at the time of the interrupt are not disturbed (this is covered in more detail in the interrupt section of this guide). In KPSM3 that only has one bank of registers, a common technique is to preserve the contents of registers in scratch pad memory before those registers are used again by a subroutine. The values are then fetched from memory to restore those values before returning to the main program. This is still a perfectly valid technique in KPSM6 programs but it can result in a significant number of STORE and FETH instructions consuming code space and slowing program execution. By switching to the B bank of registers at the start of an intense subroutine or when servicing and interrupt you could effectively provide yourself with 6 temporary registers in one instruction cycle (2 system clock cycles) automatically preserving the contents of registers in bank A. Although it is useful to have two banks of registers that are isolated and independent this also presents a challenge when it comes to data being passed between a main program and a subroutine. Once again a solution is to assign particular scratch pad memory locations which are then accessed by both sections of code using different register banks but this can be somewhat constraining as well. For this reason the Send To Alternate Reregister or STAR instruction provides you with a way to pass information from a register in the active bank (sy) to a register in the inactive bank (). sf se sd Active Bank sf se sd Inactive Bank STAR, sy s2 s2 Hint STAR, sy is almost exactly the same as a LOAD, sy and also has no effect on the states of the flags. However it should be recognised that STAR s, s is definitely not the equivalent of a no-operation because each reference to s is in a different bank and therefore the contents of s in the inactive bank will probably be changed. s s s s Example STAR se, s se in the inactive back is loaded with a copy of s in the active bank (illustrated in the diagram above). ASSEMBLER ODING REQUIREMENT Page 7 The alternate register must be specified using a default name s to sf. Any NAMEREG directives do not apply to the specification of. The current active register sy must be specified using an active name for a register (i.e. NAMEREG does apply as normal). These are deliberate coding rules intended to minimise the probability of coding mistakes (i.e. They force you to think carefully about what bank is active).

19 General Purpose I/O Ports Input Ports D B A A = PORT B = PORT = PORT 2 D = PORT 3 [7:] [7:] [7:] [7:] [] [] [7:] [7:] kcpsm6 instruction in_port bram_enable address out_port write_strobe read_strobe [:] [7:] your_program enable address clk interrupt sleep reset clk k_write_strobe port_id interrupt_ack [7:] [3] [2] [] instruction rdl Output Ports E D [7:] = PORT 8 E D [7:] Y = PORT 4 E D [7:] X = PORT 2 This diagram represents one possible arrangement in which KPSM6 can be used to service 4 input ports and 4 general purpose output ports. Each port is up to 8-bits and could be connected directly to pins on the device package or may connect to some of your other logic within the device. All KPSM6 designs build on variations of this fundamental arrangement. [] E D [7:] W = PORT Page 72

### 8051 Programming. The 8051 may be programmed using a low-level or a high-level programming language.

8051 Programming The 8051 may be programmed using a low-level or a high-level programming language. Low-Level Programming Assembly language programming writes statements that the microcontroller directly

Post Configuration Access To SPI Flash A KCPSM6 Reference Design for the KC705 Evaluation Board Ken Chapman 18 th March 2013 Disclaimer Notice of Disclaimer Xilinx is disclosing this Application Note to

### MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

### 150127-Microprocessor & Assembly Language

Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an

### Unit 5 Central Processing Unit (CPU)

Unit 5 Central Processing Unit (CPU) Introduction Part of the computer that performs the bulk of data-processing operations is called the central processing unit (CPU). It consists of 3 major parts: Register

### ORG ; ZERO. Introduction To Computing

Dec 0 Hex 0 Bin 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

### Feature of 8086 Microprocessor

8086 Microprocessor Introduction 8086 is the first 16 bit microprocessor which has 40 pin IC and operate on 5volt power supply. which has twenty address limes and works on two modes minimum mode and maximum.

### PART B QUESTIONS AND ANSWERS UNIT I

PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional

### MICROPROCESSOR AND MICROCOMPUTER BASICS

Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

### EE 110 Practice Problems for Exam 2: Solutions, Fall 2008

EE 110 Practice Problems for Exam 2: Solutions, Fall 2008 1. Circle T (true) or F (false) for each of these Boolean equations. (a). T FO An 8-to-1 multiplexer requires 2 select lines. (An 8-to-1 multiplexer

### ib technology Data Sheet Magswipe.pdf 8 Pages Last Revised 05/03/05 Micro RWD EM4001 Mag swipe Decimal Output Version

Data Sheet Magswipe.pdf 8 Pages Last Revised 05/03/05 Micro RWD EM4001 Mag swipe Decimal Output Version This version of the Micro RWD product behaves in the same manner as the standard Micro RWD EM4001

### Initial Design for Spartan-3E Starter Kit

Initial Design for Spartan-3E Starter Kit (LCD Display Control) Ken Chapman Xilinx Ltd 16 th February 2006 Rev.2 Limitations Limited Warranty and Disclaimer. These designs are provided to you as is. Xilinx

### PROBLEMS (Cap. 4 - Istruzioni macchina)

98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary

### (Refer Slide Time: 00:01:16 min)

Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control

### Decimal Number (base 10) Binary Number (base 2)

LECTURE 5. BINARY COUNTER Before starting with counters there is some vital information that needs to be understood. The most important is the fact that since the outputs of a digital chip can only be

### UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering EEC180B Lab 7: MISP Processor Design Spring 1995 Objective: In this lab, you will complete the design of the MISP processor,

### Z80 Instruction Set. Z80 Assembly Language

75 Z80 Assembly Language The assembly language allows the user to write a program without concern for memory addresses or machine instruction formats. It uses symbolic addresses to identify memory locations

### Serial Communications

Serial Communications 1 Serial Communication Introduction Serial communication buses Asynchronous and synchronous communication UART block diagram UART clock requirements Programming the UARTs Operation

### PIC Programming in Assembly. (http://www.mstracey.btinternet.co.uk/index.htm)

PIC Programming in Assembly (http://www.mstracey.btinternet.co.uk/index.htm) Tutorial 1 Good Programming Techniques. Before we get to the nitty gritty of programming the PIC, I think now is a good time

### 2 Programs: Instructions in the Computer

2 2 Programs: Instructions in the Computer Figure 2. illustrates the first few processing steps taken as a simple CPU executes a program. The CPU for this example is assumed to have a program counter (PC),

### Entex Adventurevision Technical Specs V1.2 By Daniel Boris 12/18/2005

Entex Adventurevision Technical Specs V1.2 By Daniel Boris 12/18/2005 Disclaimer: All the information in this document comes from studying the actual Adventurevision hardware. The only technical document

### 8085 INSTRUCTION SET

DATA TRANSFER INSTRUCTIONS Opcode Operand Description 8085 INSTRUCTION SET INSTRUCTION DETAILS Copy from source to destination OV Rd, Rs This instruction copies the contents of the source, Rs register

### Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

7 Objectives After completing this lab you will: know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine Introduction Branches and jumps provide ways to change

### Chapter II Binary Data Representation

Chapter II Binary Data Representation The atomic unit of data in computer systems is the bit, which is actually an acronym that stands for BInary digit. It can hold only 2 values or states: 0 or 1, true

### Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,

### MACHINE ARCHITECTURE & LANGUAGE

in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based

### DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV UNIT I THE 8086 MICROPROCESSOR 1. What is the purpose of segment registers

### ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

Software ISO 7816 I/O Line Implementation Features ISO 7816-3 compliant (direct convention) Byte reception and transmission with parity check Retransmission on error detection Automatic reception at the

### Generating Timing Sequences

Experiment 3 Generating Timing Sequences Objective The aim of this lab experiment is to generate timing sequences using software delays and programming 8253 Programmable Interval Timer (PIT) chip. Equipment

### Zilog ZSO. Microprocessor Update: Photo 7: The Z80 microprocessor evaluation board.

Photo 7: The Z80 microprocessor evaluation board. Microprocessor Update: Zilog ZSO Burt Hashizume PO Box 172 Placentia CA 92670 One feature of the Z80 not found in other 8 bit microprocessors is a built

### Part IA Engineering. Contents of Handout 2. Digital Circuits & Information Processing. Handout 2. Sequential Logic

Part IA Engineering Contents of Handout 2 Digital Circuits & Information Processing Handout 2 Sequential Logic ichard Prager Tim Flack anuary 29 Section A Section B Section C Section D Section E Binary

### Interrupts. Hardware and Software interrupts and event-driven programming

Interrupts Hardware and Software interrupts and event-driven programming References and Resources Introduction to Embedded Programming ASM and C examples http://www.scriptoriumdesigns.com/embedded/interrupts.php

### 13-1. This chapter explains how to use different objects.

13-1 13.Objects This chapter explains how to use different objects. 13.1. Bit Lamp... 13-3 13.2. Word Lamp... 13-5 13.3. Set Bit... 13-9 13.4. Set Word... 13-11 13.5. Function Key... 13-18 13.6. Toggle

### 8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Features Compatible with MCS-51 products On-chip Flash Program Memory Endurance: 1,000 Write/Erase Cycles On-chip EEPROM Data Memory Endurance: 100,000 Write/Erase Cycles 512 x 8-bit RAM ISO 7816 I/O Port

### 2011, The McGraw-Hill Companies, Inc. Chapter 3

Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

### C What Happens INTRODUCTION PIC MICROCONTROLLER PRODUCT OVERVIEW SELECTING A DEVICE FOR EXPERIMENTS PIC16F818

C What Happens INTRODUCTION PIC MICROCONTROLLER PRODUCT OVERVIEW SELECTING A DEVICE FOR EXPERIMENTS PIC16F818 Pins and functions Package Clock oscillator Reset Ports Special Features PIC microcontroller

### PART OF THE PICTURE: Computer Architecture

PART OF THE PICTURE: Computer Architecture 1 PART OF THE PICTURE: Computer Architecture BY WILLIAM STALLINGS At a top level, a computer consists of processor, memory, and I/O components, with one or more

### Here 4 is the least significant digit (LSD) and 2 is the most significant digit (MSD).

Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

### Introduction to Design of a Tiny Computer

Introduction to Design of a Tiny Computer (Background of LAB#4) Objective In this lab, we will build a tiny computer in Verilog. The execution results will be displayed in the HEX[3:0] of your board. Unlike

### 8254 PROGRAMMABLE INTERVAL TIMER

PROGRAMMABLE INTERVAL TIMER Y Y Y Compatible with All Intel and Most Other Microprocessors Handles Inputs from DC to 10 MHz 8 MHz 8254 10 MHz 8254-2 Status Read-Back Command Y Y Y Y Y Six Programmable

### Counters. Non-synchronous (asynchronous) counters A 2-bit asynchronous binary counter High

Counters Learning objectives Understanding the operation and characteristics of asynchronous and synchronous counters Analyze counter circuits and counter timing diagrams Determine the sequence of a counter

### AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES 1. Introduction C8051F3xx and C8051F41x devices are equipped with an SMBus serial I/O peripheral that is compliant with both the System Management

### Module 4. Programmable Logic Control Systems. Version 2 EE IIT, Kharagpur 1

Module 4 Programmable Logic Control Systems Version 2 EE IIT, Kharagpur 1 Lesson 19 The Software Environment and Programming of PLCs Version 2 EE IIT, Kharagpur 2 Instructional Objectives After learning

### Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of

### Embedded Systems Dr Santanu Chaudhury Department of Electrical Engineering IIT Delhi Lecture 5 ARM Processor

Embedded Systems Dr Santanu Chaudhury Department of Electrical Engineering IIT Delhi Lecture 5 ARM Processor In the last class we had discussed PIC processors which were targeted primarily for low end

### Computer Organization and Architecture

Computer Organization and Architecture Chapter 3 Top-Level View of System Function and Interconnection Computer Components Von Neumann Architecture Data and Instructions stored in single r/w memory Contents

### Intro to Microprocessors and Microcomputers

Intro to Microprocessors and Microcomputers Content Microprocessor, microcontrollers and microcomputers Communication within microcomputers Registers Process architecture CPU Data and program storage Negative

### Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Technical Note TN-29-06: NAND Flash Controller on Spartan-3 Overview Micron NAND Flash Controller via Xilinx Spartan -3 FPGA Overview As mobile product capabilities continue to expand, so does the demand

### Figure 2.4(f): A T flip flop

If the T input is in 0 state (i.e., J = K = 0) prior to a clock pulse, the Q output will not change with the clock pulse. On the other hand, if the T input is in 1 state (i.e., J = K = 1) prior to a clock

### The University of Nottingham

The University of Nottingham School of Computer Science A Level 1 Module, Autumn Semester 2007-2008 Computer Systems Architecture (G51CSA) Time Allowed: TWO Hours Candidates must NOT start writing their

### A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc

### ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

ETEC 2301 Programmable Logic Devices Chapter 10 Counters Shawnee State University Department of Industrial and Engineering Technologies Copyright 2007 by Janna B. Gallaher Asynchronous Counter Operation

### Lab 4 Large Number Arithmetic. ECE 375 Oregon State University Page 29

Lab 4 Large Number Arithmetic ECE 375 Oregon State University Page 29 Objectives Understand and use arithmetic and ALU operations Manipulate and handle large numbers Create and handle functions and subroutines

### Seven-Segment Display

ENEE 245: Digital Circuits & Systems Lab Lab 8 Seven-Segment Display ENEE 245: Digital Circuits and Systems Laboratory Lab 8 Objectives The objectives of this laboratory are the following: To become familiar

### Week Assembly Language Programming Chapter 2

Week 2 8051 Assembly Language Programming Chapter 2 1 Outline 2.1 Inside the 8051 2.2 Introduction to 8051 Assembly programming 2.3 Assembling and running an 8051 program 2.4 The program counter and ROM

### Chapter 5. Processing Unit Design

Chapter 5 Processing Unit Design 5.1 CPU Basics A typical CPU has three major components: Register Set, Arithmetic Logic Unit, and Control Unit (CU). The register set is usually a combination of general-purpose

### The goal is to program the PLC and HMI to count with the following behaviors:

PLC and HMI Counting Lab The goal is to program the PLC and HMI to count with the following behaviors: 1. The counting should be started and stopped from buttons on the HMI 2. The direction of the count

### Traditional IBM Mainframe Operating Principles

C H A P T E R 1 7 Traditional IBM Mainframe Operating Principles WHEN YOU FINISH READING THIS CHAPTER YOU SHOULD BE ABLE TO: Distinguish between an absolute address and a relative address. Briefly explain

### Demo program from Lecture #1

Registers start MOV total, a ; Make the first number the subtotal ADD total, total, b ; Add the second number to the subtotal ADD total, total, c ; Add the third number to the subtotal ADD total, total,

### Interfacing Analog to Digital Data Converters

Converters In most of the cases, the PIO 8255 is used for interfacing the analog to digital converters with microprocessor. We have already studied 8255 interfacing with 8086 as an I/O port, in previous

### Monitoring of Intravenous Drip Rate

Monitoring of Intravenous Drip Rate Vidyadhar V. Kamble, Prem C. Pandey, Chandrashekar P. Gadgil, and Dinesh S. Choudhary Abstract A drip rate meter, for monitoring intravenous infusion, is developed using

### Technical Support Bulletin Nr.18 Modbus Tips

Technical Support Bulletin Nr.18 Modbus Tips Contents! Definitions! Implemented commands! Examples of commands or frames! Calculating the logical area! Reading a signed variable! Example of commands supported

### Keil C51 Cross Compiler

Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation

### Decimal Numbers: Base 10 Integer Numbers & Arithmetic

Decimal Numbers: Base 10 Integer Numbers & Arithmetic Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 )+(1x10 0 ) Ward 1 Ward 2 Numbers: positional notation Number

### The counterpart to a DAC is the ADC, which is generally a more complicated circuit. One of the most popular ADC circuit is the successive

The counterpart to a DAC is the ADC, which is generally a more complicated circuit. One of the most popular ADC circuit is the successive approximation converter. 1 2 The idea of sampling is fully covered

### Chapter 7D The Java Virtual Machine

This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

### Design of a Video Game

Tallinn University of Technology Dept. of Computer Engineering Chair of Digital Systems Design Design of a Video Game Project in IAY0070 HW/SW Co-design Anti Sullin 020633 IASM-21 04.2006 Project supervisor:

### AN 223: PCI-to-DDR SDRAM Reference Design

AN 223: PCI-to-DDR SDRAM Reference Design May 2003, ver. 1.0 Application Note 223 Introduction The Altera PCI-to-DDR SDRAM reference design, which you can download to the Stratix PCI development board,

### Modbus Protocol. PDF format version of the MODBUS Protocol. http://www.http://www.modicon.com/techpubs/toc7.html. The original was found at:

Modbus Protocol PDF format version of the MODBUS Protocol The original was found at: http://www.http://www.modicon.com/techpubs/toc7.html (In case of any discrepancies, that version should be considered

### Week 7. The 8088 and 8086 Microprocessors

Week 7 The 8088 and 8086 Microprocessors 8086 and 8088 Microprocessors 8086 announced in 1978; 8086 is a 16 bit microprocessor with a 16 bit data bus 8088 announced in 1979; 8088 is a 16 bit microprocessor

### 6. SEQUENTIAL AND CONCURRENT STATEMENTS IN THE VHDL LANGUAGE

Structure of Computer Systems Laboratory No. 6 1 6. SEQUENTIAL AND CONCURRENT STATEMENTS IN THE VHDL LANGUAGE A VHDL description has two domains: a sequential domain and a concurrent domain. The sequential

### PIPELINING CHAPTER OBJECTIVES

CHAPTER 8 PIPELINING CHAPTER OBJECTIVES In this chapter you will learn about: Pipelining as a means for executing machine instructions concurrently Various hazards that cause performance degradation in

### CHAPTER 7: The CPU and Memory

CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides

### Introduction Number Systems and Conversion

UNIT 1 Introduction Number Systems and Conversion Objectives 1. Introduction The first part of this unit introduces the material to be studied later. In addition to getting an overview of the material

### Simple Practice Programs. ; store the higher byte

Simple Practice Programs Program 1: - Exchange the content of FFh and FF00h Solution: - Here one is internal memory location and other is memory external location. so first the content of ext memory location

### Tutorial. Introduction to 8085 Architecture and Programming

Tutorial On Introduction to 8085 Architecture and Programming Contents 1. Internal architecture of 8085 microprocessor 2. 8085 system bus 3. 8085 pin description. 4. 8085 functional description. 5. Programming

### BV4221. USB to I2C Terminal. Product specification. January 2008 V0.a. ByVac 2006 ByVac Page 1 of 7

Product specification January 2008 V0.a ByVac 2006 ByVac Page 1 of 7 Contents 1. Introduction...3 2. Features...3 3. Physical Specification...3 4. Terminal Interface...3 5. s...4 6. The I2C Set...4 6.1.

### Reliance Reliance Cool Muscle Cool Muscle - RS-232 Link Protocol

Reliance Reliance Cool Muscle Cool Muscle - RS-232 Link Protocol Cool Muscle - RS-232 Link Protocol The character data sent back by Cool Muscle motors connected together on a daisy chain is a mixture

### CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles First, a little about you Your name Have you ever worked with/used/played with assembly language? If so, talk about it Why are you taking

### Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Digital Logic 1 Data Representations 1.1 The Binary System The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. The system we

### Unit 8 : Microprocessor Architecture

Unit 8 : Microprocessor Architecture Lesson 1 : Microcomputer Structure 1.1. Learning Objectives On completion of this lesson you will be able to : draw the block diagram of a simple computer understand

### Simulation & Synthesis Using VHDL

Floating Point Multipliers: Simulation & Synthesis Using VHDL By: Raj Kumar Singh - B.E. (Hons.) Electrical & Electronics Shivananda Reddy - B.E. (Hons.) Electrical & Electronics BITS, PILANI Outline Introduction

### Stepper Motor Driver (74194)

Stepper Motor Driver (74194) This page features an inexpensive stepper motor driver that could be used to power slow speed projects on the layout or other hobby applications. Based on the SN74LS194 - Bidirectional

### PIC32 Architecture Overview

PIC32 Architecture Overview 2008 Microchip Technology Incorporated. All Rights Reserved. PIC32 Architecture Overview Slide 1 Hello and welcome to the PIC32 Architecture Overview webinar. My name is Nilesh

### Introduction to C for Atmel XMega

Introduction to C for Atmel XMega 1 Menu Overview of C Basics Variables, Types, and Definitions Conditionals Ports and Registers Interrupts Pointers Strongly Using C with Assembly 2 1 Overview of C Basics

### Application Note 195. ARM11 performance monitor unit. Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007

Application Note 195 ARM11 performance monitor unit Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007 Copyright 2007 ARM Limited. All rights reserved. Application Note

### Hello and welcome to this Renesas Interactive course, that provides an overview of the Clock Generator found on RL78 MCUs.

Hello and welcome to this Renesas Interactive course, that provides an overview of the Clock Generator found on RL78 MCUs. 1 This course provides an introduction to the RL78 Clock Generator. Our objectives

### Lecture 8: ARM Arithmetic and Bitweise Instructions

Lecture 8: ARM Arithmetic and Bitweise Instructions CSE 30: Computer Organization and Systems Programming Winter 2014 Diba Mirza Dept. of Computer Science and Engineering University of California, San

### plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

plc numbers - 3. Topics: Number bases; binary, octal, decimal, hexadecimal Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

### An Introduction to the ARM 7 Architecture

An Introduction to the ARM 7 Architecture Trevor Martin CEng, MIEE Technical Director This article gives an overview of the ARM 7 architecture and a description of its major features for a developer new

### Section 14. Compare/Capture/PWM (CCP)

M Section 14. Compare/Capture/PWM (CCP) HIGHLIGHTS This section of the manual contains the following major topics: 14.1 Introduction...14-2 14.2 Control Register...14-3 14.3 Capture Mode...14-4 14.4 Compare

### CPU12. Introduction. CPU12 Programming Model. The CPU12 Central Processing Unit M68HC12 and HCS12 microcontrollers

CPU12 The CPU12 Central Processing Unit M68HC12 and HCS12 microcontrollers Babak Kia Adjunct Professor Boston University College of Engineering Email: bkia -at- bu.edu ENG SC757 - Advanced Microprocessor

### Programmer s Model. ARM7TDMI-S Data Sheet. Final - Open Access

3 Programmer s Model This chapter describes the two operating states of the ARM7TDMI-S. 3.1 Processor Operating States 3-2 3.2 Switching State 3-3 3.3 Memory Formats 3-4 3.4 Instruction Length 3-5 3.5

### Flip-Flops, Registers, Counters, and a Simple Processor

June 8, 22 5:56 vra235_ch7 Sheet number Page number 349 black chapter 7 Flip-Flops, Registers, Counters, and a Simple Processor 7. Ng f3, h7 h6 349 June 8, 22 5:56 vra235_ch7 Sheet number 2 Page number

### Microprocessor-Based Automatic Door Opener

Microprocessor-Based Automatic Door Opener Jitendra Chaudhary UG201110012 CSE, IIT Jodhpur Hemraj Kumawat UG201110011 CSE, IIT Jodhpur Abstract A microprocessor controlled automatic door opener including

### Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

Dr. Greg Tumbush, gtumbush@uccs.edu Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts) Objective The objective of lab assignments 5 through 9 are to systematically design and implement

### Design of a SPI receiver

Design of a SPI receiver (2010, SzP, LJ) The goal of the lab is, to design a digital thermometer, which is connected to the FPGA through an SPI interface. The temperature should be displayed fi on the

### 1 Classical Universal Computer 3

Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer 3 1.1 Von Neumann Architecture 3 1.2 CPU and RAM 5 1.3 Arithmetic Logical Unit (ALU) 6 1.4 Arithmetic Logical Unit