{6}library{0} {6}ieee{5};{0} {6}use{0} {6}ieee{5}.{6}std_logic_1164{5}.{6}all{5};{0} {6}use{0} {6}ieee{5}.{6}std_logic_arith{5}.{6}all{5};{0} {6}entity{0} {6}x{0} {6}is{0} {6}port{5}({0} {6}rst{0} {5}:{0} {6}in{0} {6}std_logic{5};{0} {6}clk{0} {5}:{0} {6}in{0} {6}std_logic{5};{0} {6}d{0} {5}:{0} {6}in{0} {6}std_logic{5};{0} {6}q{0} {5}:{0} {6}out{0} {6}std_logic_vector{5};{0} {6}a{5},{0} {6}b{0} {5}:{0} {6}in{0} {6}std_logic{5};{0} {6}v{0} {5}:{0} {6}out{0} {6}std_logic{0} {5});{0} {6}end{0} {6}x{5};{0} {6}architecture{0} {6}behavioral{0} {6}of{0} {6}x{0} {6}is{0} {6}signal{0} {6}q_i{0} {5}:{0} {6}std_logic_vector{5}({6}q{0}'{6}range{5});{0} {6}begin{0} {6}v{0} {5}<={0} {6}a{0} {6}when{0} {6}b{0} {5}={0} {4}'1'{0} {6}else{0} {4}'0'{5};{0} {6}gen{5}:{0} {6}for{0} {6}j{0} {6}in{0} {6}q{0}'{6}low{0} {6}to{0} {6}q{0}'{6}high{0} {6}generate{0} {6}gen_first{5}:{0} {6}if{0} {6}j{0} {5}={0} {6}q{0}'{6}low{0} {6}generate{0} {6}variable{0} {6}foo{0} {5}:{0} {6}boolean{0} {5}:={0} {6}false{5};{0} {6}begin{0} {6}stage1{5}:{0} {6}process{0} {5}({6}rst{5},{0} {6}clk{5}){0} {6}begin{0} {6}if{0} {6}rst{0} {5}={0} {4}'1'{0} {6}then{0} {6}q_i{5}({6}j{5}){0} {5}<={0} {4}'0'{5};{0} {6}elsif{0} {6}rising_edge{5}({6}clk{5}){0} {6}then{0} {6}q_i{5}({6}j{5}){0} {5}<={0} {6}d{5};{0} {6}case{0} {6}a{0} {6}is{0} {6}when{0} {3}1{0} {5}=>{0} {6}when{0} {3}2{0} {5}=>{0} {6}when{0} {6}others{0} {5}=>{0} {6}end{0} {6}case{5};{0} {6}end{0} {6}if{5};{0} {6}end{0} {6}process{5};{0} {6}else{0} {6}generate{0} {6}stages{5}:{0} {6}process{0} {5}({6}rst{5},{0} {6}clk{5}){0} {6}begin{0} {6}if{0} {6}rst{0} {5}={0} {4}'1'{0} {6}then{0} {6}q_i{5}({6}j{5}){0} {5}<={0} {4}'0'{5};{0} {6}elsif{0} {6}rising_edge{5}({6}clk{5}){0} {6}then{0} {6}for{0} {6}u{0} {6}in{0} {3}0{0} {6}to{0} {3}7{0} {6}loop{0} {6}q_i{5}({6}j{5}){0} {5}<={0} {6}q_i{5}({6}j{0} {5}-{0} {3}1{5});{0} {6}end{0} {6}loop{5};{0} {6}end{0} {6}if{5};{0} {6}end{0} {6}process{5};{0} {6}end{0} {6}generate{5};{0} {6}end{0} {6}generate{5};{0} {6}L{5}:{0} {6}case{0} {6}expression{0} {6}generate{0} {6}when{0} {6}choice1{0} {5}=>{0} {6}when{0} {6}choice2{0} {5}=>{0} {6}end{0} {6}generate{0} {6}L{5};{0} {6}end{0} {6}behavioral{5};{0}