双向移位器寄存器,-28. 4位双向移位寄存器 - 4位双向移位寄存器
8. 4位双向移位寄存器
场景:演示数据在寄存器中的左移、右移和并行加载。 核心逻辑:数组操作模拟移位过程,配合动画效果。
@Entry
@Component
struct ShiftRegister {
@State register: number[] = [0, 0, 0, 0]
shiftLeft() {
// 左移,低位补0
animateTo({
duration: 300 }, () => { 拼多多帮助力入口
this.register.shift()
this.register.push(