Q.Is ARC Von Neumann or Harvard?
A: Hello, Von Neumann is combined data and program memory (both stored in same RAM), Harvard has separate. Only the 6502 is Von Neumann of the ones we focused on in CPS310, the lab1 computer, PIC16C5X, ARC, and Atmel AVR 8535 are all Harvard architecture.
Q.How many status flags are there for AVR? Are they Z,N,V,C,H,S,I,T?
A. The only ones we covered in class are the basic ZNVC status bits. Most processors, including the 6502, have extra bits for things like interrupts, etc. These are not on the test.
Q. Also, will the data sheet for AVR given on the exam?
A. Yes, everything you got on the labs relevant to the different processors will be on it.
Q. How do u do comparison in PIC16C5X, b/c there is no command for that? A. As with any processor we covered you can perform subtractions and test the Z flag, or to test individual bits you can use logical operations like AND. With the PIC16C5X there are instructions to test individual bits for branches.
Q. on lec slides 20_21 slide #11 we have Size of data: 8, 16, 32 bits. Eg. C: OCR1A = 0x4D7E; Assembly (AVR) ldi r18, 0x4D sts OCR1AH, r18 ldi r18, 0x4D sts OCR1AH, r18 just confused what is "OCR1AH" in this case and why do we use r18 twice ?
A. OCR1A is a 16-bit register. The Atmel 8535 only has an 8-bit wide data bus and so we need to perform two writes to move the desired 16 bit value into the register. OCR1A has two registers appearing in the I/O space for IN/OUT instructions: OCR1AL and OCR1AH. This was a major part of lab 9 dealt with setting 16-bit registers with two 8-bit accesses. For each we must load some register, any register, with the high and low bytes (with immediate mode LDI instructions) and write the value with STS or OUT instructions. We need to load each byte in two instructions, LDI and STS (or OUT) since we don't have a "write immediate value to memory" directly in one instruction.
Q. i understand that for loading a 16 bit in AVR u need to load each 8 bits twice, but how come for that one where OCR1A=0x4D7E, you never bothered about the 7E part? it was never loaded. A. I believe there might be a mistake in that sample code. As with all the 16-bit register writes in Lab 9 the upper byte 0x4d should go to OCR1AH, the lower 0x7e should be written to OCR1AL.
Q. On lec slides 20_21 slide #15 there is RJUMP used for AVR when we do jump second time and i was jus wondering does it make a bit difference with JUMP or doesn't really matter? 3. on lec slides 16_17 slide #6 the X in the last line for AVR... i'm confused where is it coming from...
A. My mistake, there is only RJUMP for the AVR, there is a JUMP for the Atmega168 but not the Atmega8535.
Q. for RJUMP in AVR: in the instruction set there is a JMP instruction on page 347, so do we use it?
A.I only see 321 pages for the 8535 datasheet. Oh, you are looking at the Atmega168? Yes, you are, there is a JUMP instruction as well in the Atmega168. The 168 is almost the same as the 8535 but has minor differences, you found one of them. The test is on the Atmega8535.
Q. On lec slides 16_17 slide #6 the X in the last line for AVR... i'm confused where is it coming from...
A. The LDS r1,X instruction uses the X register for an indirect memory read (the contents of the 16-bit X register form the address, the contents of this address are loaded into register r1). Your question is where does C come from. As per page 11 of the data sheet, the 16-bit X register is accessed bytewise as registers r26,r27. So when using the X, Y, or Z index registers, such as for loops, you first two 8-bit registers for each.
Q. if we have to convert ARC instructions to binary on exam, will we be given the opcode for ADD and OR instructions or we have to memorise it?
A. I won't ask anything not on the data sheets (such as in the lab). No memorization required of ARC binary patterns.
Q. lec 20_21 slide #10 question 18 18. Once the head is positioned over the sector to be read, what is the data transfer rate in bytes per second for this drive? Will we calculate the answer like that: Transfer rate = 7200 rpm / 60 seconds * 512 sectors * 1024 bytes per sector = 60 MB/s
A. Yes..
Q. what will be the maximum length of the program for all processors ?
A. Equals 2^N where N = # of bits in address bus, this tells you the full addressing space of a bus. With a Harvard architecture with separate memory and data there would be a separate memory bus, the number of bits in this address bus would define the largest possible program. But most processors don't fill their entire space with program, so it depends on the device. I won't ask this question.
Q. the address space for 6502 - 2^24? (from the max length of the instruction) ?
A. No, There are 16 address lines in the 6502 so the addressing space is 2^16=65536=0x10000. The 6502 has a shared bus (Von Neumann architecture) so the program has to be smaller than that to leave room for RAM, peripherals, etc.
Q. And also, for AVR, when u add 0x19 with 0x92, the result is 0xAB, where the 7th bit is on. So I was just wondering will the N flag be on in this case? but then u are only adding two positive numbers, so why would the N bit be on?
A. The processor does not know if you're using 2's complement signed or unsigned numbers, as with the 6502, it sets the N-flag if the MSB (D7) is set to a 1 after the last ALU operation. So when programming you ignore the N flag, i.e. don't use branch instructions that use it, when you aren't doing 2's complement math and want to check for negative numbers.
Course Management Form
Lectures
Several lectures refer to slides by the textbook author Miles Murdocca. Here are the original slides . It appears some page numbers may have changed in the online slides (i.e. use the original slides).
Exam Preparation
CPS 310 Microprocessors
In this course we will use a variety of simulated and real processors.
Labs
TA's: Lab sections Monday 8:00-10:00 and Monday 10:00-12:00 have Vahab Akbarzadeh (vahab DOT akbarzadeh AT ryerson.ca (changed from before, please use this address)). NOTE: see note above about possible change of first section's time
Computer Architecture and Organization: An Integrated Approach
Miles J. Murdocca, Internet Institute, USA
Vincent P. Heuring, University of Colorado
ISBN: 978-0-471-73388-1
©2007, 544 pages
I suggest the less expensive online version.