Replies: 2 comments 4 replies
-
I think you should implement the shifter using wire splitters. It's really straight forward. You should have a underflow and overflow flag as well. I can post a circuit if more help is needed.
The built-in barrel shifter is not synthesizable to HDL.
-
TWJ
…________________________________
From: gixslayer ***@***.***>
Sent: Monday, January 2, 2023 12:18:46 PM
To: hneemann/Digital ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [hneemann/Digital] Carry output in BarrelShifter (Discussion #1089)
For our course where student design a processor I'm considering letting students implement a logical shift left and logical shift right (they already implement a rotate left). This is easy enough to accomplish with the BarrelShifter component. The problem is I'd also like to emulate the behavior of ARM/x86 in terms of the carry flag (last bit rotated/shifted out, unless a 0 rotation/shift was given). Doing this in circuits is possible, but trickier/messier than I'd like for these shifts. I therefore see the following options:
1. Have a BarrelShifter (variant) that outputs the desired carry bit natively in Digital, see here<gixslayer@2f68fb0> for an example implementation in terms of desired logic.
2. Implement and distribute a custom BarrelShifter variant.
3. Provide them with helper circuits that implement this.
Option 1 would be the nicest from our perspective, though I don't know if there is any desire for such a component, or if it would just clutter the library. Option 2 is undesirable as we currently only use stock Digital features, and I'd rather not maintain and push extra jar components to students for just this feature. Option 3 would would be acceptable, but create a bit more clutter at the circuit level compared to option 1.
What do you think of such a carry flag in the BarrelShifter? A useful addition, or too specific to our case?
—
Reply to this email directly, view it on GitHub<#1089>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKQPU32DT63MKXX5STYTPU3WQMEXNANCNFSM6AAAAAATO7JTQA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
The idea of a barrel shifter is to shift a variable number of bits. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For our course where student design a processor I'm considering letting students implement a logical shift left and logical shift right (they already implement a rotate left). This is easy enough to accomplish with the BarrelShifter component. The problem is I'd also like to emulate the behavior of ARM/x86 in terms of the carry flag (last bit rotated/shifted out, unless a 0 rotation/shift was given). Doing this in circuits is possible, but trickier/messier than I'd like for these shifts. I therefore see the following options:
Option 1 would be the nicest from our perspective, though I don't know if there is any desire for such a component, or if it would just clutter the library. Option 2 is undesirable as we currently only use stock Digital features, and I'd rather not maintain and push extra jar components to students for just this feature. Option 3 would would be acceptable, but create a bit more clutter at the circuit level compared to option 1.
What do you think of such a carry flag in the BarrelShifter? A useful addition, or too specific to our case?
Beta Was this translation helpful? Give feedback.
All reactions