library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity multiplier is
port
(
a : in
std_logic_vector(7 downto 0);
result : out
std_logic_vector(15 downto 0);
result_integer : out integer
);
end multiplier;
architecture arch of multiplier is
constant number : std_logic_vector (7 downto 0):="01110111"; ---binary 119
begin
result <= a * number;
result_integer <= conv_integer(a * number);
---optional. its required if you want to see result in
integer
end arch;
------------------------------------------------------------------------------------------------------------------------------------------------

VI. Write the shortest sequence of instructions to multiply a value b concurrent statements. (8 p...
3. Write the shortest sequence of VHDL statements to multiply a 16 bit unsigned variable x by constant 113 without using a multiplication operator
Write a sequence of MIPS instructions to find the absolute value of the value in register $s0 and store it into register $t0. Assume you do not have access to multiplication instructions. Use as few instructions as possible. You do not have to assemble your code for this question, but you may do so to validate that it works.
8051 assembly Write code to multiply the contents of the B register by 77. (2 instructions.) Based on your code, in which register would you expect to find the most significant byte of the product? Write code to divide the contents of the A register by 10. (2 instructions.) Based on your code, in which register would you expect to find the remainder?
Write a sequence of normal assembly language instructions corresponding to the following sequence of high-level language statements. Assume that each variable (A, B. C, and D) is one word in memory. If notequalto B then C: =5; else C: =10; D: =50;
(a) Write "continuous assign statement" in Verilog HDL for the output Z described by the below bread board setup. [Note that all the gates are NOR gates.) (8 points) V VCC GND GND O O VCC O (b) Write Verilog HDL for circuit in (a) using if-else statements within an always block. (6 points) (c) Write Verilog HDL for circuit in (a) using case statements within an always block. (6 points)
2. (8 points) A sequence of statements is listed below: b = (a+4)/2 c=2* b-5 d = 3*c+ 7 {d>4} calculate the weakest precondition of the sequence.
can you please solve this CORRECTLY?
Exercise 4 - Shortest path (25 pts) Using Dijkstra's algorithm, find the shortest path from A to E in the following weighted graph: a- Once done, indicate the sequence (min distance, previous node) for nodes D and E. (15pts) b- Below is a high-level code for Dijkstra's algorithm. The variables used in the code are self-explanatory. Clearly explain why its running time (when we use a min-heap to store the values min distance of...
ents Conditional Read as Related Conditionals Inverse Use the following ng statements to write conditional statements. Determine the truth value p: a line is tangent to a cirdle; q: it is perpendicular to the radius 9. Conditional: Truth Value: 10. Inverse: Truth Value: 11. Converse: Truth Value: 12. Contrapositive: Truth Value: - Topic 4: Bi-Conditional Statements Read as: Bi-Conditional True when both conditional (-9) and converse (q → p) are true! Write the conditional and converse of each statement below,...
Translate each of the following pseudo-instructions into MIPS instructions. You should Produce a minimal sequence of MIPS instructions to accomplish the required computation. (8 Points) 1) bgt $t1, 100, Label # bgt means branch if greater than 2) ble $s2, 10, Next # ble means branch if less than or equal 3) ror $s0, $s4, 7 # ror means rotate right $s4 by 7 bits and store the result in $s0 4) neg $s5, $s4 # $s5 will have the...
3- [8 points] Write the following sequence of code into RISC-V assembler: x=x-y-z+4; Assume that x, y, and z are stored in registers x18, x19, and x20 respectively.