DSP notes, the 2nd

DSP Notes, The 2nd time

Am I happy? I don’t know, but I will try to be. By Mr.liar
This chapter I will mainly focus on the instruct system, it’s a part of assemble language, and I will begin with the TMS320C6000 chip’s instruct system, most of the content is public instruct set, about it’s property. Then something about liner assembly and pseudoinstruction(伪指令).

  1. reflection between instruction and function unit(fu)
      Each instruction will correspond to some fu, and some will have a huge cost, we need to consider about it, theoretically the more logic operation, the quicker the fu work. Meanwhile, the complexity of the instruction will make a great influence to the delay time of the fu. For example, a multiply of divide instruction will cost many fu, so it will invoke for many unit, on the other hand, the arithmetic operation is based on the logic operation, so we have to decide which part of unit works first(time delay).
      The multiple operation requires 1 unit of time interval, while the load instruction will need 4, the transfer of file need 5. That’s mean we use our board to move the file most of the time, some operation like logic and or instruction store will not need any time delay.
      each instruction in the C6000 is 32 bit, and each of them will reflect to a line of assemble code. but we need to recognize which is the instruction code ,and which will decide to perform the operate condition, and which will provide the register to store the result after the CPU work.
      Here the term field(字段) is very important, the op field is a concrete instruction code to tell the CPU what to do, and like creg or z field is the judgement and so on.
  2. Assembly format

       Label(optional):
       Parallel Bars: Every parallel bars have the lowest bit as p bit, the p bit is a mark, for example, we have four instruction here, and the former two have a 1 as their p bit, and the latter two have a 0 as it p bit, then the former three instructions will be executed in the same period, and the last one will be in the next period. the processor can deal with at most 8 instructions at the same period and 8 instruction can be described as a instruction package.(The last p bit must be 0)
      Conditions: every instruction can be conditional operation, whether add the judgement is optional, but it can be applied into any instruction code of assemble language.
       Instructions: include pseudoinstruction and command mnemonic(命令助记符), these instructions can be regarded as the code in senior language, they can not be execute directly, but it’s easier to write and understand.
      Functional units: C6000 have 8 functional unit, in the last chapter, we had simply talked about some unit like .l and .s, they are in another system, we can assign the one of the eight units as a .l unit or .s unit. and select concrete instruction in the assigned unit.
      Operands: each of the construction must have at least one operand, it can be variable of constant, and the operand comes form other register. The operands are divided into three kinds: register/constant/pointer operands.
      Comments: explain how the code work.(optional) when we use a ; to write comments, the comments can be written anywhere, but if we use a ** * **, then we have to begin our comment from the first line of the code.
  3. C6000 public instruction set
    3.1. Load/store instruction:
      Load read data from the data storage and send it to the universal register. while store will perform the opposite task. here are several notices for it:
    a. Difference between signed and unsigned instructions, the LDB/LDH read some signed number, after writing the byte into reg, it will execute some extension action to decide the sign of the number. the LDBU/LDHU will read a unsigned number(No extension)
    b. Data type influence the offset of address: all the address pf data is store in the unit of byte, so after different instruction like LDB(U)/LDH(U)/LDW, they will correspondingly multiply proportion factor:1/2/4 so as STB/STH/STW
    c. data type will influence the end range of address.

3.2. arithmetic operation instructions:
a. these instructions are mainly about add/subtract: they are distinguished by their operand, so it include signed/unsigned, different bit of the number.
  About this, we shall learn from C instead of here, yet there is still a problem exist: overflow of the calculation, CPU will not report the phenomenon so we need to take care about it. But we can choose some special instruction that will give a hint the register has up to it’s limit and not reset to 0.There is also some special ways like: multiply the number with a factor less than 1(decrease the precision of the number)
b. Fixed-pointed instructions
  Sometime when we need to transform a decimal number to a integrate number, that is accessible, but we shall finish it by ourselves, if you’ve touched with matlab, high probability that you know we can use function like floor or round, we can achieve these functions in the assemble language. we can decide how to deal with the decimal part of the number.
c. Some other instructions like ABS, ADDK and SAT(no more introduction!!!)

3.3. Multiply instructions
   C6000 is based on 16*16 hardware multiplying units, they can be divided into two kinds:
a. instructions suitable for integrate multiply: the answer is set as 32 bit operate number, and consider the sign and the high/low half bit word constitute 16 kinds of instructions
b. suitable for the decimal number: a little complicated, anyway, they will find the bit of decimal point and deal with the sign bit. then the other part is similar to a.

3.4 logic instructions
a.bool instructions: and/or/xor, that easy if you’ve learned the digital circuit, Ican’t figure it out in this chapter;
b.shift instruction: SHL/SHR/SHRU/SSHL move the bit in logic or in arithmetic regularity.
  bit operation instructions: CLK/SET/EXT/LMBD, that’s all in digital circuit
  compare and judge instruction: CMPEQ/CMPGT/CMPLT

3.5. move instructions
  Like MV/MVC/MVK, they are responsible for the data communication.

3.6. program file shift instructions
  Four kinds of instructions: a. Labe; b.register illustrate the address transfer instruction; c. instructions to get address from maskable interrupt reg; d. instructions to get address from unmaskable reg.
   The shift instructions will have five instruction delay gap, that’s deserve to focus.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值