‫Welcomes the Alieu arithmetic logic unit explain lecture in this lecture I'm going to explain what North
‫tech logic unit is and what will be designing and implementing on our FPGA for this lab.
‫What is an arithmetic logic unit in Alieu is a part of a processor that performs all the logical and
‫mathematical operations and the ACLU is very critical because it determines which mathematical operations
‫or processor supports.
‫If you're doing an image an addition subtraction multiplication division or any other mathematical operation
‫it's all going to go through the arithmetic logic unit.
‫And when you're designing an embedded system or selecting what kind of processor you want to use or
‫if you're designing your own processor and FPGA or Nasik you're going to have to there there's several
‫questions you have to ask yourself what do we want the Alieu to support.
‫And some of these common questions will be was the number of floating point operations per second.
‫If you're doing like a digital signal processing application you need to know how many of these operations
‫can you do and your certain timeframe.
‫So it becomes very important.
‫And also the number of multiply and accumulate instructions per second if doing a good digital filtering
‫operation this is very critical.
‫Another thing you have to take into consideration what is the core size the common you have are 8 that
‫16 bit 32 bit or 64 bit.
‫If you're doing a really small and obviously the larger your bit size is of your core size.
‫The more expensive your processor typically is.
‫So you have to do that tradeoff.
‫What do I need and what can I spend.
‫In our case we're going to be designing one in VHDL.
‫We're going to have it so we can have it an eight 16 32 64 128 will make it so that we can select any
‫size core size we want what the different parts of the arithmetic logic unit they vary.
‫You can customize them and design them in any way but the very basic or the core parts of an arithmetic
‫logic are.
‫You have various inputs and various outputs and these inputs you have a B in code your input is one
‫of the values that you're going to be operating on.
‫And same with your B input.
‫This is another value you're going to be operating on.
‫And so depending upon your core size if you have a core size 8 that's your a and b are going to be 8
‫bits wide.
‫Same if you like the core size of 32 bits you're a and b are going to be 32 bits wide and so on and
‫so forth.
‫And as we'll see in the lab we can make this configurable so you to select the core size and you automatically
‫make a and b and all the other signals and registers that need to be that size.
‫Why exactly assume that then you also have the opcode.
‫This determines the operation of the ACLU or the multiplying or subtracting or dividing and that's based
‫on the input of the opcode and we'll go through and explain a little more detail how the opcode interacts
‫with a A and B inputs.
‫You also have the outputs which we have the result in the air.
‫The result is as the name indicates the result of your operation.
‫So if my opcode says I want to add my result it's going to be a plus b if I'm going to subtract my results
‫going to be a minus B or BMI my essay and that's all going to be determined by the opcode.
‫And then also all have an air.
‫This will tell you if you have certain operations one if your opcode is telling you to do something
‫that your Alieu doesn't support or a lot of times this is a very commonly used with an overflow flag.
‫If you're doing an addition an A and B are such large numbers that the result is not large enough it
‫can't fit in there or it overflows.
‫You'll get an there and you can also add different things onto your alle Alieu earth to logic.
‫This is just kind of a basic general set of where you most likely start.
‫Now let's talk about Alieu instruction set.
‫So for example as I said you want to support multiple different instructions so your opcode is what's
‫determining what the output is.
‫So we have a table.
‫And when you're designing an Alieu you want to have a table that tells the user or whoever you are designing
‫this for can understand OK what are my different operations the Alieu supports.
‫So for example mount code zero I'll get an output of say the code is 1 I get an output a B if my code
‫is for I get not a version of AA.
‫And in this case we have opcodes 0 through 11.
‫So we're supporting 12 different operations and we can have the many operations as we want.
‫Just the more you add the more complex and maybe the more expensive it is we have to make a decision
‫what operations do I need.
‫Logical and mathematical do I need my arithmetic logic unit to support my processor.
‫Now let's talk about the VHDL representation of an arithmetic logic unit.
‫So now we kind of understand OK here's the background here's what I want it to do.
‫I have an opcode I have a B results.
‫Err how to actually make that happen in the HGL.
‫Well the way you would do that and there are various ways but the way I would suggest or the way I would
‫do it is using a case statement.
‫So for example we have a process we're calling state up and we have the inputs or in the sensitivity
‫list opcode A and B.
‫So anytime I change my opcode or I change my A or my B value my result in my air my outputs are going
‫to be updated.
‫So we'll begin a K-State and then make the most sense that is K-State operate on the opcode because
‫based on the opcode is going to determine what we do with a and b to get our result in air.
‫So in this case we have a opcode if the opcode is all zeroes the output is a refer back to the opcode
‫table.
‫So my result is equal to A.
‫And I don't have any errors.
‫So air is equal to zero.
‫Just Similarly if my opcode is one my output is B.
‫So now my result is equal to the B and my air is equal to zero.
‫And if I do my now is equal to then I know that my output is a plus b.
‫So my result is equal to A plus B.
‫My air is equal to zero.
‫And so if we add more instructions we would just extend this case statement.
‫So if we have if we support 100 different Alieu instructions in my case is going to have 100 different
‫cases and you can kind of customize or add more cases as your instruction set to Alieu grows.
‫And so this is just kind of an example way you could represent an Alieu and VHDL.
‫Now you understand how when Alieu is and how it works let's get started designing one.