Nt1310 Unit 4 Assignment

977 Words4 Pages

The signal with the lowest value is taken into consideration. As said in the previous section (hue calculation algorithm) it is available for us on the bus can be used for this computation. This improves the worktime and also reduces the burden on the device. Minimum value is to be multiplied with an integer value ‘3’, which is same for every change in the input values. This can be done directly by giving similar datatypes and now the value is multiplied with 3. The next thing is to have the sum value of all the three input signals, after the sum division has to take place. In division, minimum value multiplied with 3 goes into the nominator and the sum value goes into the denominator. Since the nominator is greater than the denominator division …show more content…

Firstly I used LIBRARY IEEE, USE IEEE.STD_LOGIC_1164.ALL, and USE IEEE.STD_LOGIC_UNSIGNED.ALL as my libraries for this part implementation. I have taken all the three input signals R, G, B (all are unsigned) of an integer type which can have values from 0 to 255 (since they are all 8 bit inputs) as my input ports and Saturation (STD_LOGIC_VECTOR) as my output ports. The algorithm for computation of saturation is given by equation 5. The first thing to do is compare the magnitude of the three input signals R, B and G, to get the minimum signal comparisons has to be done among the input signals. Since minimum value is required no need to include the maximum value condition in the code, so Condition if (r<b) gives us the minimum value as GREEN. When the both conditions fails it’s pretty obvious that the only signal left out will be the minimum signal, hence we got …show more content…

Now I had nominator and denominator with me so that I can perform the division function now. Unlike in Intensity part I had done Shift division method and the subtraction method together in the saturation part. I started a divide process, whenever a change in nominator or denominator is registered it enters the process. I have declared few variables, stores the data. Variables count, count1, k, Nu are used, among these the datatypes sand their ranges differ. I initialised the count value to ‘0’ and declared the k variable as “100000000” and Variable Nu is equal to “00000000” & Num because in this algorithm division function has low nominator compared to denominator so we end up with fraction values like 0.25, 0.33 etc. To do the binary division in this case is pretty challenging, one should have a better understanding and basic knowledge of how it’s done. Binary shift division is the solution to the problem here, whenever the nominator is lower than denominator value is shifted to the left by adding a ‘0’ to the last digit of the value until the nominator gets bigger than denominator and when denominator fits in nominator subtraction is done and a new value

More about Nt1310 Unit 4 Assignment