  Recently, some infinite families of minimal and optimal binary linear codes
were constructed from simplicial complexes by Hyun {\em et al.} We extend this
construction method to arbitrary posets. Especially, anti-chains are
corresponded to simplicial complexes.
  In this paper, we present two constructions of binary linear codes from
hierarchical posets of two levels. In particular, we determine the weight
distributions of binary linear codes associated with hierarchical posets with
two levels. Based on these results, we also obtain some optimal and minimal
binary linear codes not satisfying the condition of Ashikhmin-Barg.
