Questions tagged [sll]

sll stands for "shift left logical", an operation on a bit vector in VHDL. Use this tag for questions about this operation in the context of VHDL programming

Performs a logical (filled with zeros on the right) shift left of a vector in VHDL.

Use Model:

signal a_reg : std_logic_vector(31 downto 0);

a_reg <= "10101010101010101010101010101010";

a_reg <= a_reg sll 3;

This will shift a_reg left by three and the new value will be:

01010101010101010101010101010000
19 questions
0
votes
0 answers

MIPS shift left logical

What would be another way to write the code below? li $t1, 1 # load 1 in register $t1 sll $t1, $t1, 23 # shift value of 1 to the 24th bit to get 1000 0000 0000 0000 0000 0000 I am concerned that this code does not not actually shift 1 to…
0
votes
1 answer

Can someone explain the following MIPs code?

f,g,h,i,j == $s0-$s4. Base address of arrays A and B are $s6 and $s7 sll $t0, $s0, 2 add $t0, $s6, $t0 sll $t1, $s1, 2 add $t1, $s7, $t1 lw $s0, 0($t0) as far as i understand, the first line takes the value of f*4 and stores it in $t0. ive been…
Isaak Johnson
  • 129
  • 3
  • 8
0
votes
0 answers

Checking number of zeros in a MIPS array

I have a question as follows: Given an array of 32-bit signed integers in the memory and its length in one of the registers, write a MIPS program that counts how many zeros the array contains. Assume that the array starts at Ox12345678, and the…
Dhruv Ghulati
  • 2,976
  • 3
  • 35
  • 51
-1
votes
1 answer

Shifting in MIPS using a formula

Im learning MIPS and coming from a procedural programming background its proving difficult. This is a question i came across when it came to shifting. If there are any pointers in answering it, it would be appreciated. Suppose that rt is a register…
1
2