# 2016q3 Homework 1 (clz) ###### tags: `sysprog21` `JongSyuGithub` contributed by <`JonSyuGithub`> github: https://gtihub.com/JonSyuGithub/clz ## Environment * OS: Ubuntu 16.04 LTS * CPU: [i5-457](http://ark.intel.com/products/75043/Intel-Core-i5-4570-Processor-6M-Cache-up-to-3_60-GHz) * Memory 12GB ($ cat /proc/meminfo) * Update & Install ``` $ sudo apt-get update $ sudo apt-get install build-essential $ sudo apt-get install linux-tools-common linux-tools-generic $ sudo apt-get install astyle colordiff gnuplot ``` ## Objective * Understanding the description about count leading zero (clz) from "https://hackmd.io/s/SkKZBXZT" and comparsion of performance between the following version: * recursive version * iteration version * binary search technique * byte-shift version * Harley’s algorithm ## Git ``` # setting parameter $ git config --global user.email "your e-mail" $ git config --global user.name "your name" $ git config --global push.default matching $ git remote set-url origin https://github.com/JonSyuGithub/clz-tests.git # update $ git add . $ git commit -m "initial import" $ git push ``` ## Running * Compile & Run ``` $ make $ make plt ``` * 每個方法執行4000000的時間差 ![](https://i.imgur.com/Fb7Ijf0.png) ## References * [A04: clz](https://hackmd.io/s/B1LHefQ6)