MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

Size: px
Start display at page:

Download "MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS"

Transcription

1 MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS EXAMINATION FOR COMPUTER SYSTEMS Semester I Time allowed: THREE (3) hours THIS IS A CLOSED BOOK EXAMINATION ANSWER ALL QUESTIONS SECTION A 28 Multi-choice Questions each worth 1 mark 28 marks Record your answers to the questions in Section A on the Mark Sense Card provided. SECTION B Three Questions each worth 24 marks 72 marks Write your answers to the questions in Section B in the blue answer booklet provided Total: 100 marks Marks for each question are shown in brackets after the question, like this [8 marks] Note that in some of the questions in this exam, the abbreviations hi and lo may have been used to signify logic high (5V for TTL, 12V for CMOS) and logic low (0V for TTL and CMOS) signals respectively. Page 1 of 19

2 SECTION A 1 If a weather system has sensors that report whether or not it s cloudy, whether or not it s too cold for outdoor sport, and whether the wind speed exceeds 20 kilometres per hour or not, then how many rows would there be in a Truth table that listed all types of weather that the system can distinguish? (A) 3 (B) 8 (= 2 x 2 x 2) (C) 80 (= 2 x 2 x 20) (D) Don t be silly. You can t possibly list all weather types in a single table of finite size. 2 The diagram below shows the start of a circuit diagram. In the diagrammatic conventions we ve used in this paper, what type of diagram would this image belong to, and what are the benefits of starting the diagram this way? A B C (A) It s the first stage of a random access memory device. The labels A, B, and C represent the control signals for Accessing, Bounce-suppression and Chip-select. The benefits are that Bounce-suppression does not have to be handled as a separate entity, and the Accessing signal amalgamates Read-enable and Write enable as a single signal that enables reading when the signal is TRUE and writing when it is FALSE. (B) It s the first stage of a combinatorial circuit. The benefits are that AND gates in the rest of the diagram can access any input (or its inverse), and because of the regular layout of the input signals, it s very easy to read the Boolean expression that the diagram corresponds to. (C) It s the first stage of a combinatorial circuit. The benefits are that the highly regular nature of the set of signals (i.e., fact that the signals A, B, and C are in ascending sequence) makes it easy to relate the semantic content of the diagram to the significance of the signals in the outside world. (D) It s the first stage of a counter. The benefits are that these signals which are control signals - are separate from the data signals that the counter will process. Furthermore, the amplifiers (the triangles on the right hand wires) increase the voltage so that the inputs to be sent to a large number of stages, and thus the counter can have many bits. Page 2 of 19

3 3 Does a demultiplexor invert its output? (A) Yes, always. (B) Yes, but only under exceptional circumstances. (C) Yes, often. (D) No, never. 4 In analysing the behaviour of an RS flip flop, we normally make an assumption. What is that assumption, and why do we make it? (A) We need to assume that the device is currently in memory mode, because otherwise its initial output can t be guaranteed. (B) We need to assume the value of one of the outputs, because the circuit involves feedback, and thus one of its inputs can t be externally set. (C) We need to assume that R and S are different from each other (one high and the other low). This prevents the device from malfunctioning (blowing up). (D) We need to assume that the clock speed is higher than the data-set time (the time for the output to settle to a stable value after the input has changed) for the circuit. This gives the external circuitry time to react when a new value is loaded into the flip-flop 5 In a random access memory (A) the size of the words must be smaller than the size of the addresses. (B) tri-state circuitry must not be used to connect the output to the data line, because the data line has only two values, in and out. (C) the word random means that words can be accessed in any order. (D) the incoming data value is fed into a decoder, and the output from the decoder is used to select a particular word in memory. 6 A ripple counter (A) is frequently used in wave mechanics calculations. (B) involves much simpler flipflops (i.e. D flipflops) than a synchronous counter (which uses JK flipflops). (C) can cause problems when it is important that spurious (false) intermediate values are not generated in the transition between two valid numbers. (D) should be clocked in several stages, so that the ripple effect can catch up between the flipflops. 7 In an ASM (A) diamonds (or hexagons) contain unconditional outputs. (B) diamonds (or hexagons) represent conditional outputs. (C) diamonds (or hexagons) denote clock transitions. (D) diamonds (or hexagons) contain conditional tests. Page 3 of 19

4 8 In an ASM (A) the first state should always be 0. (B) a state should never cycle immediately back to itself; there should always be an intervening state, even if the outputs are the same. (C) a reset-on-powerup circuit can be used to ensure that the ASM starts in state 0. (D) the first state should always be a wait state, where the circuit is waiting for some condition to be fulfilled before embarking on the rest of the cycle of states. 9 A decoder (A) transfers an input value on one of 2 n inputs to a single output line. The input is chosen on the basis of the value on an n-bit control input. (B) is an essential part of a shift register, as it determines which of the flipflops will receive the incoming data. (C) should only produce one TRUE output at a time. (D) can be replaced by a multiplexor, if the control and data inputs are reversed. 10 Multiplexors are used in ASMs (A) because their internal design is generally simpler than the combinatorial circuitry that they replace. (B) because they re cheaper than nearly all other types of digital circuit. (c) because they turn output generation from a calculation to a lookup, which is easy to understand and easy to modify. (d) only when all other alternatives have been exhausted. 11 Shift registers (A) have to alternate between shift left operations and shift right operations. (B) should only be constructed with falling-edge triggered flip flops. (C) are gradually being phased out in sensitive applications (such as encryption hardware). (D) shift information in one direction at a time. 12 A single data input connected to a set of independently loadable flipflops would be called (A) a tri-state input. (B) a conductor. (C) a control input. (D) a bus. Page 4 of 19

5 13 A computer processor (A) cannot be programmed to overwrite its own program. (B) is used in recycling stations to separate the parts of old PCs into different groups, according to how they can be reused. (C) uses the same representation for program and for data that a program uses and generates. (D) is the device that implements the instruction set for a computer, and sends commands to the architecture to perform the tasks associated with each instruction. 14 A computer instruction (A) is represented within the computer by an English word that is interpreted during a series of clock cycles. (B) is represented within the computer by a series of English-like words that form a sentence. (C) is the same thing as an address. (D) is represented within the computer by a binary code that is interpreted during a series of clock cycles. 15 After the following sequence of 8051 instructions has executed data equ $50 start mov $50,#1 mov $51,#'A' mov $52,#2 mov $53,#'B' mov r1,#data inc r1 mov r0,data mov a,r1 add a,r0 inc a mov r0,a mov a,@r0 ; Set up Data Memory ; Test Code which value will be left in the accumulator? (A) 1 (B) 'A' (C) 2 (D) 'B' Page 5 of 19

6 16 Interrupts are used to (A) simplify programming and allow multiple activities to (apparently) run concurrently. (B) replace subroutines when the Global Interrupt Enable (EA) bit is a 0. (C) handle arithmetic on multibyte values. (D) simplify programming by delegating all complex tasks to the ALU. 17 Which of the following is NOT correct? The stack in the 8051 microcontroller is important because (A) it provides a way to reuse the same memory to hold temporary data. (B) it provides a place to save subroutine return addresses. (C) using the stack, recursive subroutines can call themselves at least 128 times. (D) it provides a method of passing parameters to subroutines. 18 An embedded microcontroller system is (A) a small computer system that doesn't use a program counter, just registers. (B) a system pre-programmed to perform a fixed task. (C) one that does not need any I/O (input/output) (D) one that must run only from batteries. 19 The following 8051 subroutine has one parameter, passed in the accumulator xxx: push again: jnz sjmp doit: clr subb sjmp done: pop ret acc doit done c a,#1 again acc If subroutine xxx is called in the following way mov a,#119 lcall xxx (A) it finds the total of all numbers from 1 to 119. (B) it continuously increments the stack pointer. (C) it subtracts one from the initial parameter, being sure to clear the carry bit first. (D) it provides a variable delay, the length of which is controlled by the parameter. Page 6 of 19

7 20 In the 8051, the carry bit is often cleared before subtraction but not addition. This is because (A) the addition operation only generates a carry-out but does not use a carry-in. (B) the subtraction operation depends on the decrement operation and the carry is used as a flag (like the F bit) to ensure the operation puts the result in the accumulator (as expected). (C) subtraction is a less frequent operation than addition, so to optimise the usage of bits available to encode instructions, the designers chose to make the processor have only one subtract instruction (which always includes the carry bit). For the lowest byte of a multi-byte instruction, the carry bit must be zero to give a correct result. (D) the carry bit is not relevant to subtraction; it is only used by the Add-withcarry (ADDC) instruction. 21 Start and stop bits (A) are used to synchronise a receiver to the start and end of an arriving chunk of data, usually a byte. (B) are the same. (C) can have data values piggybacked onto them. (D) invert from one byte to the next. 22 Frequency modulation (A) uses an analogue wave with two different frequencies to transmit unidirectional binary data and four different frequencies to transmit simultaneous bidirectional binary data. (B) becomes more effective at data rates in excess of 1MB s -1. (C) is only used for FM radio transmissions. (D) is less effective at data rates in excess of 1MB s Hamming codes (A) can be used to correct single bit errors. (B) should be used in situations where it is likely that errors are smeared over a large number of successive bytes. (C) can be used to detect single bit errors and detect 2-bit errors simultaneously (D) should not be used in situations where it is likely that errors are smeared over a large number of successive bytes. 24 The IP protocol (A) is designed to throw away data under certain conditions. (B) has error correction facilities that guarantee that it will deliver correct data. (C) is designed to work over fibre optic links. (D) is designed to run over satellite links. Page 7 of 19

8 25 Class B IP addresses have (A) 128 networks with 16 million hosts. (B) 16K networks with 64K hosts. (C) 2 million networks with 254 hosts. (D) an arbitrary number of hosts, as they are used for multicasting applications. 26 Flooding is not used as a data delivery mechanism in networks because (A) it s a very inefficient use of network bandwidth. (B) it came along too late; it would have been ideal, but other delivery mechanisms were entrenched by the time the benefits were realised. (C) it is not robust in military applications, as the flood can easily be blocked. (D) it simply cannot be used to carry data; only route calculations can be performed this way. 27 In Dijkstra s algorithm (A) there is no way of taking the varying costs of different links into account. (B) the route to a node is calculated by adding the best current candidate to a tree of existing start points. (C) the route to a node is stored in a central database that is updated by uploading the routes along a tree with its root at the node containing the central database. (D) the route between every pair of nodes in a network involves an independent calculation. 28 In a data communications network constructed according to the ISO model (A) intermediate nodes are passive with respect to the binary content of the data packets. Thus they only need to implement the physical layer of the model. (B) intermediate nodes do not have to implement the complete ISO stack. (C) intermediate nodes are unnecessary. (D) intermediate nodes always contain 5 levels of the stack. Page 8 of 19

9 SECTION B (long answers) Answer questions 29 to 31 in the blue answer booklet provided Write the numbers of the questions you have answered from this Section on the front cover of your blue answer booklet DO NOT DO tie the Scantron Mark Sense Card into your blue answer booklet tie the ancillary sheet into your blue answer booklet Page 9 of 19

10 29 (A) Draw a circuit for a four-bit synchronous counter. [6 marks] (B) Design a circuit that inputs a 2-bit number and outputs it successor (if the input is 2, the output is 3, if the input is 3 the output is 0 and so on). [6 marks] (C) A number of devices need to be controlled. Each one has a start input, and should start operating when that input becomes true. The devices start in sequence (i.e. one after the other, on successive clock cycles). Design a control circuit that uses a counter and a decoder can be used to produce the start signals, and stops producing start signals as soon as another signal, stop becomes TRUE. This circuit does not need to be an ASM [6 marks] (D) A separate sheet has been distributed with this exam, showing the ASM diagram for the PicoComputer. Some labels have been omitted from the exit paths of some conditional tests. CLEARLY indicate what the labels should be and the exit paths that they should be attached to. Write your name and ID number on the sheet and tie it into your exam script. [6 marks] 30 (A) Show how the following statements could be translated into 8051 assembler. Literal translations are not required, just code that implements the same functionality. (i) X:= X + Y 17; Note: the variables X and Y are one byte variables. [2 marks] (ii) ch:= getch; i := 0; while ( (ch <> '?') AND (ch <> '.') ) do begin mystring[i] := ch; (* Assume mystring starts at Data Memory location $50 *) i:= i+1; ch:= getch; end; The preceding code fragment builds a string. You may assume that: a subroutine called getch already exists. It loads the accumulator with the next character that the user inputs. mystring is a block of memory starting at location $50 in data memory [4 marks] Page 10 of 19

11 (iii) for i:= 0 to 19 do M[i]:= 0; You may assume that the array M is stored in a block of memory that starts at Internal Data Memory location $50. [2 marks] (B) The 8051 instructions CLR C and SET C affect the carry bit. Illustrate how this bit is used by writing a subroutine to add multi-byte numbers. On entry to the subroutine: - r0 contains the address of the first (the least significant) byte of N1, the first number - r1 contains the address of the first byte of N2, the second number - r7 contains the number of bytes in each number (they're the same) The numbers are stored so that the least significant byte is stored at the specified memory address and any additional bytes are stored in consecutive memory locations in ascending address order. The result of the addition is stored in the same memory as N2 (the subroutine overwrites N2 it implements N2:= N1 + N2). [8 marks] (C) Describe what interrupts are and why they are used. [4 marks] (D) The 8051 status register contains the following bits. CY AC - F0 - RS1 - RS0 OV - F1 - P Describe the purpose of each bit. [4 marks] 31 (A) A sender and receiver are using the Lempel-Ziv compression algorithm. Write down their code tables after (i) one character (ii) two characters (iii) three characters of the message hello had been transmitted, if the initial agreed code was 1 h 2 e 3 l 4 o [6 marks] Page 11 of 19

12 (B) In an IP network, segment A is capable of carrying packets containing 65K bytes, and segment B is capable of carrying packets containing 5Kbytes. Data must traverse segments A and B (in that order) to go from source to destination. How does the IP protocol allow for this? In your answer, remember that the IP protocol does not guarantee to deliver packets in the correct order. [6 marks] (C) In the OSI model, there are various acronyms and jargon terms. Define the terms PDU, SAP, and peer-to-peer communication. The definitions of the terms should include, but not be restricted to, an expansion of the acronyms. Note that it could make sense to combine two of the definitions. [6 marks] (D) Draw a diagram showing how sections, lines and paths relate to the topology of a SONET network, and show, with a sketch, how the line overhead, section overhead and data are organised in a SONET frame. There s something odd about this arrangement. What is it, and what problem does it address? [6 marks] Page 12 of 19

13 8051 Architecture Reference Program Memory (Code) Address 07FFFH (8051) Internal Memory (Data) Special Function Registers* 07FFH (89C2051) 7FH I/O registers accessed via memory locations Serial Port Timer 1 Ext Interrupt 1 Timer 0 Ext Interrupt 0 Reset 0023H 001BH 0013H 000BH 0003H 0000H Interrupt Vectors (location jumped to on Interrupt) Bank Select Bits in PSW 11 { 10 { 01 { 00 { Directly Addressable Bits 0-7F RB3* RB2* RB1* RB0* * Four banks of Registers addressable as R0-R7 2FH 20H 1FH 18H 17H 10H 0FH 08H 07H 00H Reset value of Stack Pointer Program Counter: 16 bit register restricted to 0000H -> 07FFFH Special Function Registers (SFR) Space: Byte address Name Description Bits ("-" NOT bit addressable) 80H P0 Port 0 bit addressable: P0.7 -> P0.0 81H SP Stack Pointer - 82H DPL Low byte of DPTR - 83H DPH High byte of DPTR - 87H PCON Power control - 88H TCON Timer control TF1-TR1-TF0-TR0-IE1-IT1-IE0-IT0 89H TMOD Timer mode control - 8AH TL0 Timer 0 low byte - 8BH TL1 Timer 1 low byte - 8CH TH0 Timer 0 high byte - 8DH TH1 Timer 1 high byte - 90H P1 Parallel port 1 Bit Addressable P1.7 -> P1.0 98H SCON Serial control SM0-SM1-SM2-REN-TB8-RB8-TI -RI 99H SBUF Serial buffer - A0H P2 Port 2 Bit addressable: P2.7-P2.0 A8H IE Interrupt Enable EA - - -ES -ET1-EX1-ET0-EX0 B0H P3 Parallel port 3 Bit addressable: P3.7 -> P3.0 B8H IP Interrupt priority - - -PS -PT1-PX1-PT0-PX0 D0H PSW Program Status Word CY -AC -F0 -RS1-RS0-OV -F1 -P E0H ACC Accumulator ACC.7 -> ACC.0 F0H B B register B.7 -> B.0 Page 13 of 19

14 Interrupt control register IE: EA Global bit to enable interrupts ES,ETx Serial interrupt (either RI or TI), Clock interrupt on overflow Timer control and mode registers - 2 timers 0 and 1 TCON: TF0/TF1 Timer overflow flag timers 0/1 TR0/TR1 Timer run control bit. Set by software to switch timer ON TMOD: mode0-mode1 2 4-bit nibbles. Timer 1 high order nibble, Timer 0 low order. mode = 0 13 bit timer mode = 1 16 bit timer mode = 2 8 bit auto-reload timer. THx -> TLx on overflow. Used by Serial I/O as bit rate (*32). 0FDH in Thx gives 9600bps for Mhz clock Serial control register SCON: SM0-SM1-SM2-REN should be set to 0111 for normal operation TI set when the character has been transmitted RI set when a character is received Power control register PCON: set to 2 will stop the processor Addressing Modes: Rn Register R0 - R7 of the currently selected register bank. direct 8-bit internal data location's address. This could be an internal Data RAM location (0-127) or a 8-bit internal Data RAM location addressed indirectly via register R0 or R1 #data 8-bit constant included in instruction. #data1616-bit constant included in instruction. addr11 11-bit destination address. Used by ACALL and AJMP. The branch will be within the same 2K byte page of Program Memory as the first byte of the following instruction. addr16 16-bit destination address. Used by LCALL and LJMP. A branch can be anywhere within the 2K byte Program Memory address space. rel Signed (two's complement) 8-bit offset byte. Used by SJMP and all conditional jumps. Range is -128 to +127 bytes relative to first byte of the next instruction. bit Direct addressed bit in internal Data RAM or SFR. Page 14 of 19

15 Arithmetic operations: Byte Cycle C OV AC ADD A,Rn Add register to Accumulator 1 1 X X X ADD A,direct Add direct byte to Accumulator 2 1 X X X ADD A,@Ri Add indirect RAM to Accumulator 1 1 X X X ADD A,#data Add immediate data to Accumulator 2 1 X X X ADDC A,Rn Add register to Acc. with Carry 1 1 X X X ADDC A,direct Add direct byte to Acc. with Carry 2 1 X X X ADDC A,@Ri Add indirect RAM to Acc. with Carry 1 1 X X X ADDC A,#data Add immediate data to Acc. / Carry 2 1 X X X SUBB A,Rn Subtract reg. from Acc. with borrow 1 1 X X X SUBB A,direct Sub. direct byte from Acc. / borrow 2 1 X X X SUBB A,@Ri Sub. indirect RAM from Acc./ borrow 1 1 X X X SUBB A,#data Sub. imm. data from Acc. / borrow 2 1 X X X INC A Increment Accumulator 1 1 INC Rn Increment register 1 1 INC direct Increment direct byte 2 1 Increment indirect RAM 1 1 DEC A Decrement Accumulator 1 1 DEC Rn Decrement register 1 1 DEC direct Decrement direct byte 2 1 Decrement indirect RAM 1 1 INC DPTR Increment Data Pointer 1 2 MUL AB Multiply A and B X DIV AB Divide A by B X DA A Decimal adjust Accumulator 1 1 X Page 15 of 19

16 Logical operations: ANL A,Rn AND register to Accumulator 1 1 ANL A,direct AND direct byte to Accumulator 2 1 ANL A,@Ri AND indirect RAM to Accumulator 1 1 ANL A,#data AND immediate data to Accumulator 2 1 ANL direct,a AND Accumulator to direct byte 2 1 ANL direct,#data AND immediate data to direct byte 3 2 ORL A,Rn OR register to Accumulator 1 1 ORL A,direct OR direct byte to Accumulator 2 1 ORL A,@Ri OR indirect RAM to Accumulator 1 1 ORL A,#data OR immediate data to Accumulator 2 1 ORL direct,a OR Accumulator to direct byte 2 1 ORL direct,#data OR immediate data to direct byte 3 2 XRL A,Rn Exc-OR register to Accumulator 1 1 XRL A,direct Exc-OR direct byte to Accumulator 2 2 XRL A,@Ri Exc-OR indirect RAM to Accumulator 1 1 XRL A,#data Exc-OR immediate data to Acc. 2 1 XRL direct,a Exc-OR Accumulator to direct byte 2 1 XRL direct,#data Exc-OR imm. data to direct byte 3 2 CLR A Clear Accumulator 1 1 CPL A Complement Accumulator 1 1 RL A Rotate Accumulator left 1 1 Byte Cycle C OV AC RLC A Rotate Acc. left through Carry 1 1 X RR A Rotate Accumulator right 1 1 RRC A Rotate Acc. right through Carry 1 1 X SWAP A Swap nibbles within the Accumulator 1 1 Page 16 of 19

17 Data transfer: MOV A,Rn Move register to Accumulator 1 1 MOV A,direct Move direct byte to Accumulator 2 1 MOV A,@Ri Move indirect RAM to Accumulator 1 1 MOV A,#data Move immediate data to Accumulator 2 1 MOV Rn,A Move Accumulator to register 1 1 MOV Rn,direct Move direct byte to register 2 2 MOV Rn,#data Move immediate data to register 2 1 MOV direct,a Move Accumulator to direct byte 2 1 MOV direct,rn Move register to direct byte 2 2 MOV direct,direct Move direct byte to direct byte 3 2 MOV direct,@ri Move indirect RAM to direct byte 2 2 MOV direct,#data Move immediate data to direct byte 3 2 Move Accumulator to indirect RAM 1 1 Move direct byte to indirect RAM 2 2 Move immediate data to indirect RAM 2 1 MOV DPTR,#data16 Load Data Pointer with 16-bit const 3 2 MOVC A,@A+DPTR Move Code byte rel. to DPTR to Acc. 1 2 MOVC A,@A+PC Move Code byte rel. to PC to Acc. 1 2 PUSH direct Push direct byte onto stack 2 2 POP direct Pop direct byte from stack 2 2 XCH A,Rn Exchange register with Accumulator 1 1 XCH A,direct Exchange direct byte with Acc. 2 1 XCH A,@Ri Exchange indirect RAM with Acc. 1 1 XCHD A,@Ri Exchange low order digit indirect RAM with Accumulator 1 1 Byte Cycle C OV AC Number and String Formats: Numbers : Decimal - 34 Binary B Hexadecimal - a leading $ or a trailing h or H. e.g. $7F, 7Fh, 0FFH, $FF 0A8H Note: if not preceded by $ hex constants must start with 0-9. eg 0C7h Characters: Strings : Operators : 'A' - 'Abc' - A,00DH,00AH (mixed mode), "T" Only with DB directive for putting strings into CODE memory 'abc' or "abc" () + - / * MOD SHR SHL NOT AND OR XOR Page 17 of 19

18 Boolean variable manipulation: Byte Cycle C OV AC CLR C Clear Carry CLR bit Clear direct bit 2 1 SETB C Set Carry SETB bit Set direct bit 2 1 CPL C Complement Carry 1 1 X CPL bit Complement direct bit 2 1 ANL C,bit AND direct bit to Carry 2 2 X ANL C,/bit AND complement of dir. bit to Carry 2 2 X ORL C,bit OR direct bit to Carry 2 2 X ORL C,/bit OR complement of dir. bit to Carry 2 2 X MOV C,bit Move direct bit to Carry 2 1 X MOV bit,c Move Carry to direct bit 2 2 JC rel Jump if Carry is set 2 2 JNC rel Jump if Carry not set 2 2 JB bit,rel Jump if direct bit is set 3 2 JNB bit,rel Jump if direct bit is not set 3 2 JBC bit,rel Jump if dir. bit is set & clear bit 3 2 Program Branching: ACALL addr11 Absolute subroutine call 2 2 LCALL addr16 Long subroutine call 3 2 RET Return from subroutine 1 2 RETI Return from interrupt 1 2 AJMP addr11 Absolute jump 2 2 LJMP addr16 Long jump 3 2 SJMP rel Short jump (relative address) 2 2 Jump indirect relative to the DPTR 1 2 JZ rel Jump if Accumulator is zero 2 2 JNZ rel Jump if Accumulator is not zero 2 2 Byte Cycle C OV AC CJNE A,direct,rel Compare direct byte to Accumulator and jump if not equal 3 2 X CJNE A,#data,rel Compare immediate data to Accumulator and jump if not equal 3 2 X CJNE Rn,#data,rel Compare immediate data to register and jump if not equal 3 2 X Compare immediate data to indirect RAM and jump if not equal 3 2 X DJNZ Rn,rel Decr. register and jump if not zero 2 2 DJNZ direct,rel Decrement direct byte and jump if 3 2 not zero NOP No operation 1 1 Page 18 of 19

19 Assembler Directives and Controls ; Everything after a semicolon (;) on the same line is a comment Label: Must start in column 1 Defines a new Label - colon is optional. Controlling Memory Spaces and Code location ORG 56H Specify a value for the current segment's location counter. USE IRAM Makes the data space the currently selected segment USE ROM Makes the code space the currently selected segment Defining Byte and Bit values TEN EQU 10 EQUates 10 to symbol TEN, like #define in C, CONST in Delphi ON_FLAG BIT 6 Assigns BIT 6 (in data or SFR space) to the symbol ON_FLAG Allocating Memory SP_BUFFER: RMB 6 Reserves Memory Byte reserves 6 bytes of storage in current memory space (affected by most recent USE IRAM/ROM). Message: DB 'Hi' Define Byte(s): Store byte constants in code space. The following are all equivalent the string hello followed by a newline and a null. newline EQU 13 DB "H","E","L","L","O",13,0 DB "Hello",13,0 DB "Hello",newline,0 Page 19 of 19

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS EXAMINATION FOR 159.233 COMPUTER SYSTEMS Semester One June 2008 Time allowed: THREE (3) hours This exam contains THREE (3) questions ANSWER ALL THREE (3) QUESTIONS

More information

Q. Classify the instruction set of 8051 and list out the instructions in each type.

Q. Classify the instruction set of 8051 and list out the instructions in each type. INTRODUCTION Here is a list of the operands and their meanings: A - accumulator; Rn - is one of working registers (R0-R7) in the currently active RAM memory bank; Direct - is any 8-bit address register

More information

Instruction Set Of 8051

Instruction Set Of 8051 Instruction Set Of 8051 By Darshan Patel M.Tech (Power Electronics & Drives) Assistant Professor, Electrical Department Sankalchand Patel college of Engineering-Visnagar Introduction The process of writing

More information

Microcontroller Intel [Instruction Set]

Microcontroller Intel [Instruction Set] Microcontroller Intel 8051 [Instruction Set] Structure of Assembly Language [ label: ] mnemonic [operands] [ ;comment ] Example: MOV R1, #25H ; load data 25H into R1 2 8051 Assembly Language Registers

More information

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman Microprocessors 1 The 8051 Instruction Set Microprocessors 1 1 Instruction Groups The 8051 has 255 instructions Every 8-bit opcode from 00 to FF is used except for A5. The instructions are grouped into

More information

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO.

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO. INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO. ADD A,Rn Add register to 28..2F 1 12 X X X accumulator ADD A,direct Add direct byte 25 2 12 X X X to accumulator ADD A,@Ri Add indirect RAM 26..27

More information

DR bit RISC Microcontroller. Instructions set details ver 3.10

DR bit RISC Microcontroller. Instructions set details ver 3.10 DR80390 8-bit RISC Microcontroller Instructions set details ver 3.10 DR80390 Instructions set details - 2 - Contents 1. Overview 7 1.1. Document structure. 7 2. Instructions set brief 7 2.1. Instruction

More information

Dragonchip. Instruction Set Manual

Dragonchip. Instruction Set Manual Dragonchip Instruction Set Manual Version 3.1 July 2004 The Objective of this document is to provide the user a detail description to the each instruction set used in Dragonchip s MCU family. There are

More information

Embedded Controller Programming

Embedded Controller Programming Embedded Controller Programming Counters, Timers and I/O in Assembly Language Ken Arnold Copyright 2000-2004 Ken Arnold 1 Outline Timer/Counters Serial Port More 8051 Instructions Examples Copyright 2000-2004

More information

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization Program Memory The 80C51 has separate address spaces for program and data memory. The Program memory can be up to 64k bytes long. The lower 4k

More information

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MICROCONTROLLERS AND APPLICATIONS 1 Module 2 Module-2 Contents: Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MEMORY

More information

Application Brief D-005

Application Brief D-005 Interfacing the Avago HDSP-2xxx LED Alphanumeric Displays with the Intel 8751H Microcontroller Application Brief D-005 Introduction The HDSP-21xx/-25xx series of products is ideal for applications where

More information

Microcontroller. Instruction set of 8051

Microcontroller. Instruction set of 8051 UNIT 2: Addressing Modes and Operations: Introduction, Addressing modes, External data Moves, Code Memory, Read Only Data Moves / Indexed Addressing mode, PUSH and POP Opcodes, Data exchanges, Example

More information

8051 Overview and Instruction Set

8051 Overview and Instruction Set 8051 Overview and Instruction Set Curtis A. Nelson Engr 355 1 Microprocessors vs. Microcontrollers Microprocessors are single-chip CPUs used in microcomputers Microcontrollers and microprocessors are different

More information

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller EE4380 Fall 2001 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas 8051 Architecture Programmer s View Register Set Instruction Set Memory

More information

Dodatak. Skup instrukcija

Dodatak. Skup instrukcija Dodatak Skup instrukcija Arithmetic Operations [@Ri] implies contents of memory location pointed to by R0 or R1 Rn refers to registers R0-R7 of the currently selected register bank 2 ADD A,

More information

Programming of 8085 microprocessor and 8051 micro controller Study material

Programming of 8085 microprocessor and 8051 micro controller Study material 8085 Demo Programs Now, let us take a look at some program demonstrations using the above instructions Adding Two 8-bit Numbers Write a program to add data at 3005H & 3006H memory location and store the

More information

SN8F5000 Family Instruction Set

SN8F5000 Family Instruction Set SONiX Technology Co., Ltd. 8051-based Microcontroller 1 Overview SN8F5000 is 8051 Flash Type microcontroller supports comprehensive assembly instructions and which are fully compatible with standard 8051.

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP DB805C-FSM 805 Microcontroller FSM Finite State Machine General Description The Digital Blocks DB805C-FSM IP Core contains Digital Blocks compact DB805C CPU Core & GPIO

More information

Contents 8051 Instruction Set BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter I : Control Transfer Instructions Lesson (a): Loop Lesson (b): Jump (i) Conditional Lesson (c): Lesson (d): Lesson (e):

More information

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP 805 Microcontroller General Description The Digital Blocks Microcontroller Verilog IP Core is complaint with the MCS 5 Instruction Set and contains standard 805 MCU peripherals,

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP 805 SFR Bus Digital Blocks Semiconductor IP 805 Microcontroller Configurable Peripherals General Description The Digital Blocks (Configurable Peripherals) Microcontroller Verilog IP Core is complaint with

More information

Module Contents of the Module Hours COs

Module Contents of the Module Hours COs Microcontrollers (EE45): Syllabus: Module Contents of the Module Hours COs 1 8051 MICROCONTROLLER ARCHITECTURE: Introduction to Microprocessors and Microcontrollers, the 8051 Architecture, 08 1 and pin

More information

AL8051S 8-BIT MICROCONTROLLER Application Notes

AL8051S 8-BIT MICROCONTROLLER Application Notes AL8051S 8-BIT MICROCONTROLLER Application Notes 6-14-2012 Table of Contents GENERAL INFORMATION... 3 FEATURES... 3 Key features... 3 Design features... 3 INTERFACE... 4 Symbol... 4 Signal description...

More information

C51 Family. Architectural Overview of the C51 Family. Summary

C51 Family. Architectural Overview of the C51 Family. Summary Architectural Overview of the C51 Family C51 Family Summary 1. Introduction............................................................ I.1. 1.1. TSC80C51/80C51/80C31.................................................................

More information

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

Legacy documentation refer to the Altium Wiki for current information. TSK51x MCU

Legacy documentation refer to the Altium Wiki for current information. TSK51x MCU Summary Core Reference CR0115 (v2.0) March 13, 2008 The TSK51x is a fully functional, 8-bit microcontroller, incorporating the Harvard architecture. This core reference includes architectural and hardware

More information

8051 Core Specification

8051 Core Specification 8051 Core Specification Authors: Jaka Simsic Simon Teran jakas@opencores.org simont@opencores.org Rev. 0.1 August 14, 2001 First Draft www.opencores.org Rev 0.1 First Draft 1 of 26 Revision History Rev.

More information

MCS -51 Programmer s Guide and Instruction Set

MCS -51 Programmer s Guide and Instruction Set MCS -51 Programmer s Guide and Instruction Set November 1992 Order Number 270249-003 COPYRIGHT INTEL CORPORATION 1996 MCS -51 PROGRAMMER S GUIDE AND INSTRUCTION SET CONTENTS PAGE MEMORY ORGANIZATION 1

More information

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000,

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000, 8051 TUTORIAL Donal Heffernan University of Limerick May-2002 8051 Tutorial D.Heffernan 2000, 2001 1 Blank 8051 Tutorial D.Heffernan 2000, 2001 2 Some reference material: Test books + MacKenzie Scott.

More information

What Registers are available? Programming in Assembler. Assembler Programming - like early Basic. Assembler Data Movement Instructions

What Registers are available? Programming in Assembler. Assembler Programming - like early Basic. Assembler Data Movement Instructions Programming in Assembler Need knowledge of CPU 8051 Programmers model what registers are available? what memory is available? code memory (for programs) data memory (for variables and the stack) what instructions

More information

TUTORIAL Assembly Language programming (2)

TUTORIAL Assembly Language programming (2) 8051 Assembly Language programming (2) TUTORIAL 4 EEE3410 Microcontroller Applications 1. Write the instructions to move value 34h into register A and value 3Fh into register B, then add them together.

More information

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture Department of Electrical Engineering Lecture 4 The 8051 Architecture 1 In this Lecture Overview General physical & operational features Block diagram Pin assignments Logic symbol Hardware description Pin

More information

Application Brief D-002

Application Brief D-002 HCMS-29xx and HCMS-39xx Interfacing the Avago Technologies HCMS-29xx / HCMS-39xx LED Alphanumeric Displays with the Intel 8751H Microcontroller Application Brief D-002 Introduction The HCMS-29xx/HCMS-39xx

More information

Assembly Language programming (2)

Assembly Language programming (2) EEE3410 Microcontroller Applications LABORATORY Experiment 2 Assembly Language programming (2) Name Class Date Class No. Marks Arithmetic, Logic and Jump instructions Objectives To learn and practice the

More information

Introduction to uc & Embedded Systems

Introduction to uc & Embedded Systems Introduction to uc & Embedded Systems Prepared by, Tamim Roshdy Embedded Systems What is an embedded system? An embedded system is an application that contains at least one programmable computer (typically

More information

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote Programming Book1 8051 Microcontroller Kit Rev 3.0 January, 016 016 Wichit Sirichote 1 Contents Overview...3 SAFTY INFORMATION...3 Tools...3 Experiment 1 Blinking LED...4 Experiment Binary number counting...9

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 15, 2016 8051 INSTRUCTIONS JUMP, LOOP AND CALL INSTRUCTIONS 8051 INSTRUCTIONS Repeating a sequence of instructions

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2011 Chapter

More information

8051 Microcontroller Assembly Programming

8051 Microcontroller Assembly Programming 8051 Microcontroller Assembly Programming EE4380 Fall 2002 Class 3 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Topics Machine code 8051 Addressing Modes

More information

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary C51 Family Programmer s Guide and Instruction Set Summary 1. Memory Organization.................................................... I.3.2 1.1. Program Memory.......................................................................

More information

Introduction To MCS-51

Introduction To MCS-51 Introduction To MCS-51 By Charoen Vongchumyen Department of Computer Engineering Faculty of Engineering KMITLadkrabang 8051 Hardware Basic Content Overview Architechture Memory map Register Interrupt Timer/Counter

More information

Legacy documentation refer to the Altium Wiki for current information. TSK52x MCU

Legacy documentation refer to the Altium Wiki for current information. TSK52x MCU Legacy documentation TSK52x MCU Summary Core Reference CR0116 (v2.0) March 13, 2008 The TSK52x is a fully functional, 8-bit microcontroller, incorporating the Harvard architecture. This core reference

More information

ET355 Microprocessors Thursday 6:00 pm 10:20 pm

ET355 Microprocessors Thursday 6:00 pm 10:20 pm ITT Technical Institute ET355 Microprocessors Thursday 6:00 pm 10:20 pm Unit 4 Chapter 6, pp. 139-174 Chapter 7, pp. 181-188 Unit 4 Objectives Lecture: BCD Programming Examples of the 805x Microprocessor

More information

MICROPROCESSOR LABORATORY MANUAL

MICROPROCESSOR LABORATORY MANUAL MICROPROCESSOR LABORATORY MANUAL T.C. AYDIN ADNAN MENDERES UNIVERSITY ENGINEERING FACULTY ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT Prepared by: Res. Asst. Abdullah GÜLDEREN Aydın 2019 Contents 1.

More information

8051 Instruction Set

8051 Instruction Set 8051 Instruction Set 23-ug-16 ptkarule@rediffmail.com 1 Programmers Model of 8051 7FH 30H 2FH 20H 1FH 00H General Purpose Bit addressable Register Banks 1FH 18H 17H 10H 0FH 08H 07H 00H R7 R6 R5 R4 R3 R2

More information

CS 320. Computer Architecture Core Architecture

CS 320. Computer Architecture Core Architecture CS 320 Computer Architecture 8051 Core Architecture Evan Hallam 19 April 2006 Abstract The 8051 is an 8-bit microprocessor designed originally in the 1980 s by the Intel Corporation. This inexpensive and

More information

NAME as31 - An Intel 8031/8051 assembler. SYNOPSIS as31 [-h] [-l] [-s] [-v] [-Aarg] [-Ffmt] [-Ofile] infile.asm

NAME as31 - An Intel 8031/8051 assembler. SYNOPSIS as31 [-h] [-l] [-s] [-v] [-Aarg] [-Ffmt] [-Ofile] infile.asm NAME as31 - An Intel 8031/8051 assembler SYNOPSIS as31 [-h] [-l] [-s] [-v] [-Aarg] [-Ffmt] [-Ofile] infile.asm DESCRIPTION As31 assembles infile.asm into one of several different output formats. The output

More information

Core8051. Advanced v0.1

Core8051. Advanced v0.1 Advanced v0.1 Core8051 Product Summary Intended Use Embedded System Control Communication System Control I/O Control Key Features 100% ASM51 Compatible Instruction Set 1 Control Unit Eight-bit Instruction

More information

UNIT MICROCONTROLLER AND ITS PROGRAMMING

UNIT MICROCONTROLLER AND ITS PROGRAMMING M i c r o p r o c e s s o r s a n d M i c r o c o n t r o l l e r s P a g e 1 UNIT-7 8051 MICROCONTROLLER AND ITS PROGRAMMING INTRODUCTION The microcontroller incorporates all the features that are found

More information

IA8044/IA8344 Variants IA8044 4kB internal ROM with R0117 version 2.3 firmware, 192 byte internal RAM, 64kB external program and data space.

IA8044/IA8344 Variants IA8044 4kB internal ROM with R0117 version 2.3 firmware, 192 byte internal RAM, 64kB external program and data space. FEATURES Form, Fit, and Function Compatible with the Intel 8044/8344 Packaging options available: 40 Pin Plastic Dual In-Line Package (PDIP), 44 Pin Plastic Leaded Chip Carrier (PLCC) 8-Bit Control Unit

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2014 Chapter

More information

Y51 Microcontroller. Technical Manual

Y51 Microcontroller. Technical Manual Y51 Microcontroller Technical Manual Disclaimer Systemyde International Corporation reserves the right to make changes at any time, without notice, to improve design or performance and provide the best

More information

Chapter Family Microcontrollers Instruction Set

Chapter Family Microcontrollers Instruction Set Chapter 4 8051 Family Microcontrollers Instruction Set Lesson 5 Program Flow Control and Interrupt Flow Control Instructions 2 Branch instructions- Jump to new value of Program Counter (PC) LJMP address16

More information

Highlights. FP51 (FPGA based 1T 8051 core)

Highlights. FP51 (FPGA based 1T 8051 core) Copyright 2017 PulseRain Technology, LLC. FP51 (FPGA based 1T 8051 core) 10555 Scripps Trl, San Diego, CA 92131 858-877-3485 858-408-9550 http://www.pulserain.com Highlights 1T 8051 Core Intel MCS-51 Compatible

More information

8051 Programming: Arithmetic and Logic

8051 Programming: Arithmetic and Logic 8051 Programming: Arithmetic and Logic EE4380 Fall 2002 Class 4 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Topics Signed and Unsigned arithmetic Binary

More information

8051 Programming using Assembly

8051 Programming using Assembly 8051 Programming using Assembly The Instruction Addressing Modes dest,source ; dest = source A,#72H ;A=72H A, # r ;A= r OR 72H R4,#62H ;R4=62H B,0F9H ;B=the content of F9 th byte of RAM DPTR,#7634H DPL,#34H

More information

Question Bank Microprocessor and Microcontroller

Question Bank Microprocessor and Microcontroller QUESTION BANK - 2 PART A 1. What is cycle stealing? (K1-CO3) During any given bus cycle, one of the system components connected to the system bus is given control of the bus. This component is said to

More information

UNIT-III ASSEMBLY LANGUAGE PROGRAMMING. The CPU can access data in various ways, which are called addressing modes

UNIT-III ASSEMBLY LANGUAGE PROGRAMMING. The CPU can access data in various ways, which are called addressing modes 8051 Software Overview: 1. Addressing Modes 2. Instruction Set 3. Programming 8051 Addressing Modes: UNIT-III ASSEMBLY LANGUAGE PROGRAMMING The CPU can access data in various ways, which are called addressing

More information

Assembly Language programming (3)

Assembly Language programming (3) EEE3410 Microcontroller Applications LABORATORY Experiment 3 Assembly Language programming (3) Name Class Date Class No. Marks Conditional Program Branching and Subroutine Call in 8051 Objectives To learn

More information

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU VRS540-4kB Flash, 28B RAM, 25~40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com P.3 P.2 XTAL NC P0./AD VRS540 Overview

More information

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue Control Transfer Instructions Jump, Loop, and Call 1 Jump Instructions JZ label ; Jump if A=0 JNZ label ; Jump if A!=0 DJNZ reg, label ; Decrement and Jump if A (or reg.)!=0 CJNE A, byte ; Compare and

More information

Microcontroller and Applications

Microcontroller and Applications S.Y. Diploma : Sem. IV [DE/EJ/ET/EN/EX/EQ/IS/IC/IE] Microcontroller and Applications Time: 3 Hrs.] Prelim Question Paper Solution [Marks : 70 Q.1 Attempt any FIVE of the following : [10] Q.1(a) Define

More information

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-6kB Flash, 256B RAM, 40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com

More information

ELEG3923 Microprocessor Ch.6 Arithmetic and Logics

ELEG3923 Microprocessor Ch.6 Arithmetic and Logics Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.6 Arithmetic and Logics Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Arithmetic instructions Signed number operations Logic

More information

Arithmetic and Logic

Arithmetic and Logic 8051 - Arithmetic and Logic EE4380 Fall 2001 Class 8 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Signed Arithmetic - Concepts Representation of the sign

More information

EE6502- MICROPROCESSOR AND MICROCONTROLLER

EE6502- MICROPROCESSOR AND MICROCONTROLLER . EE6502- MICROPROCESSOR AND MICROCONTROLLER UNIT III - 8051 MICROCONTROLLER PART - A 1. What is Microcontroller? A device which contains the microprocessor with integrated peripherals like memory, serial

More information

MODULE-1. Short Answer Questions

MODULE-1. Short Answer Questions MODULE-1 Short Answer Questions 1. Give the comparison between microprocessor and microcontroller. It is very clear from figure that in microprocessor we have to interface additional circuitry for providing

More information

CPEG300 Embedded System Design. Lecture 6 Interrupt System

CPEG300 Embedded System Design. Lecture 6 Interrupt System CPEG300 Embedded System Design Lecture 6 Interrupt System Hamad Bin Khalifa University, Spring 2018 Correction Lecture 3, page 18: Only direct addressing mode is allowed for pushing or popping the stack:

More information

Distributed by: www.jameco.com 1-800-831-4242 The content and copyrights of the attached material are the property of its owner. 8051 8052 and 80C51 Hardware Description December 1992 Order Number 270252-006

More information

University of Toronto at Scarborough CSC CSSF - Microprocessor Systems

University of Toronto at Scarborough CSC CSSF - Microprocessor Systems Final Exam - December l&l997 University of Toronto at Scarborough CSC CSSF - Microprocessor Systems 3 hours - No notes or similar aids allowed. Marks Examiner: Gyula Lorincz P3 oc-3-20 1. Explain in detail

More information

INTEGRATED CIRCUITS P89C669 USER MANUAL. Preliminary Supersedes data of 2003 Jul Sep 16

INTEGRATED CIRCUITS P89C669 USER MANUAL. Preliminary Supersedes data of 2003 Jul Sep 16 INTEGRATED CIRCUITS P89C669 USER MANUAL Preliminary Supersedes data of 2003 Jul 30 2003 Sep 16 1 INTRODUCTION...3 1.1 The 51MX CPU CORE...3 1.2 P89C669 microcontrollers...3 1.3 P89C669 Logic Symbol...6

More information

SUMMER 13 EXAMINATION

SUMMER 13 EXAMINATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001-2005 Certified) Subject Code: 12187 SUMMER 13 EXAMINATION Model Answer Important Instructions to examiners: 1) The answers should

More information

Chapter 9. Programming Framework

Chapter 9. Programming Framework Chapter 9 Programming Framework Lesson 1 Registers Registers Pointers Accumulator Status General Purpose Outline CPU Registers Examples 8-bitA (Accumulator) Register 8-bit B Register 8-bitPSW (Processor

More information

Assembly Language Programming of 8085

Assembly Language Programming of 8085 Assembly Language Programming of 8085 Topics 1. Introduction 2. Programming model of 8085 3. Instruction set of 8085 4. Example Programs 5. Addressing modes of 8085 6. Instruction & Data Formats of 8085

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 8, 2016 Controller vs Processor Controller vs Processor Introduction to 8051 Micro-controller In 1981,Intel corporation

More information

8051 Memory Organization BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter 1: Memory Organization There are 2 types of memories available in 8051 microcontroller. Program memory/c code memory (ROM)

More information

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas 8051 - Interrupts EE4380 Fall 2001 Class 9 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Polling Vs Interrupts Polling: MCU monitors all served devices continuously,

More information

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution 1. (a) 1. (b) T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution Priority modes. 1) Fully Nested Mode : It is a general purpose mode. IR 0 highest priority IR 1 lowest

More information

CPEG300 Embedded System Design. Lecture 3 Memory

CPEG300 Embedded System Design. Lecture 3 Memory CPEG300 Embedded System Design Lecture 3 Memory Hamad Bin Khalifa University, Spring 2018 Review Von Neumann vs. Harvard architecture? System on Board, system on chip? Generic Hardware Architecture of

More information

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch HARDWARE DESCRIPTION This chapter provides a detailed description of the 80C51 microcontroller (see Figure 1). Included in this description are: The port drivers and how they function both as ports and,

More information

VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU

VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU 1134 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B 1H4 Tel: (514) 871-2447 http://www.goalsemi.com

More information

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen 8051 Single Board Monitor Programming Monitor Program Available Monitor Program Minmon - Yeralan & Ahluwalia Programming and Interfacing the 8051 Microcontroller PaulMon1 & PaulMon2 - Paul Stoffregen http://www.pjrc.com/tech/8051

More information

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families The Microcontroller Lecture Set 3 Architecture of the 8051 Microcontroller Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports. In most cases, all that is

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller 1 Salient Features (1). 8 bit microcontroller originally developed by Intel in 1980. (2). High-performance CMOS Technology. (3). Contains Total 40 pins. (4). Address bus is of 16 bit

More information

Lecture Instruction Set

Lecture Instruction Set Lecture 4 8051 Instruction Set 2 8051 Instruction Set Introduction CIP-51 architecture and memory organization review Addressing Modes Register addressing Direct addressing Indirect addressing Immediate

More information

UNIT MICROCONTROLLER

UNIT MICROCONTROLLER Page UNIT-5 805 MICROCONTROLLER INTRODUCTION The microcontroller incorporates all the features that are found in microprocessor. The microcontroller has built in ROM, RAM, Input Output ports, Serial Port,

More information

~: Simple Programs in 8051 assembly language :~

~: Simple Programs in 8051 assembly language :~ ~: Simple Programs in 8051 assembly language :~ Here some simple programs of 8051 are given to understand the operation of different instructions and to understand the logic behind particular program.

More information

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following. MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following. (9M) 1) Describe the instructions SWAP A and MOVX@DPTR,A with one example. (3Marks) SWAP A

More information

International Journal of Digital Application & Contemporary research Website: (Volume 1, Issue 2, September 2012)

International Journal of Digital Application & Contemporary research Website:   (Volume 1, Issue 2, September 2012) Area Optimized 32-Bit Pipeline RISC Processor in VHDL Swati Joshi swati_joshi20@yahoo.co.in Puran Gour purangour@rediffmail.com Abstract RISC architecture is a solution of recent era for complex computation

More information

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051:

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051: DEPARTMENT OF ECE MICROPROCESSORS AND MICROCONTROLLERS MATERIAL UNIT V 8051 MICROCONTROLLERS To make a complete microcomputer system, only microprocessor is not sufficient. It is necessary to add other

More information

CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS

CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS Addition of Unsigned Numbers The instruction ADD is used to add two operands Destination operand is always in register A Source operand can be a register,

More information

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller Subject Code:

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller Subject Code: MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller Subject Code: 17534 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given

More information

MODEL ANSWER WINTER 17 EXAMINATION Subject Title: Microcontroller and applications

MODEL ANSWER WINTER 17 EXAMINATION Subject Title: Microcontroller and applications Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate

More information

ENE 334 Microprocessors

ENE 334 Microprocessors Page 1 ENE 334 Microprocessors Lecture 10: MCS-51: Logical and Arithmetic : Dejwoot KHAWPARISUTH http://webstaff.kmutt.ac.th/~dejwoot.kha/ ENE 334 MCS-51 Logical & Arithmetic Page 2 Logical: Objectives

More information

MICROPROCESSOR & MICROCONTROLLER

MICROPROCESSOR & MICROCONTROLLER a) From road north to East From road east to north From road south to west From road west to south From road west to north b) From road north to East From road south to west From road south to north From

More information

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET 1 SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET Intel 8086/8088 Architecture Segmented Memory, Minimum and Maximum Modes of Operation, Timing Diagram, Addressing Modes, Instruction Set,

More information

8051 Microcontroller Logical Operations. Prepared by : A. B. Modi Target Audience : 5 th Semester Students

8051 Microcontroller Logical Operations. Prepared by : A. B. Modi Target Audience : 5 th Semester Students 8051 Microcontroller Logical Operations Prepared by : A. B. Modi Target Audience : 5 th Semester Students Learning Objectives After learning this chapter, Students should be able to: Describe and Use byte-level

More information